Line | |
---|
1 | void tar()
|
---|
2 | {
|
---|
3 | TString dir = gSystem->pwd();
|
---|
4 |
|
---|
5 | Int_t slash = dir.Last('/');
|
---|
6 |
|
---|
7 | TString name = &dir[slash+1];
|
---|
8 |
|
---|
9 | if (!gSystem->AccessPathName("../"+name+".tar"))
|
---|
10 | {
|
---|
11 | cout << "File '../" << name << ".tar' existing." << endl;
|
---|
12 | return;
|
---|
13 | }
|
---|
14 |
|
---|
15 | if (!gSystem->AccessPathName("../"+name+".tar.gz"))
|
---|
16 | {
|
---|
17 | cout << "File '../" << name << ".tar.gz' existing." << endl;
|
---|
18 | return;
|
---|
19 | }
|
---|
20 |
|
---|
21 | gSystem->cd("..");
|
---|
22 |
|
---|
23 | TString cmd = "tar cvf "+name+".tar --exclude=Makefile.depend --exclude=Root --exclude=Tag "+name+"/.rootrc "+name+"/*";
|
---|
24 |
|
---|
25 | cout << "Executing: " << cmd << endl;
|
---|
26 |
|
---|
27 | gSystem->Exec(cmd);
|
---|
28 | gSystem->Exec("gzip -9 "+name+".tar");
|
---|
29 |
|
---|
30 | gSystem->cd(name);
|
---|
31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.