source: trunk/MagicSoft/Mars/macros/tar.C@ 1578

Last change on this file since 1578 was 1323, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 665 bytes
Line 
1void 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=Root "+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.