From: marian Date: Wed, 31 Oct 2007 15:04:45 +0000 (+0000) Subject: Adding new function (Marian) X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=0034e1398d312b0e64415596ba6b55fa280b861b;p=u%2Fmrichter%2FAliRoot.git Adding new function (Marian) AliXRDPROOFtoolkit::XRDCopyDir(const char * idir, const char * files, const char *odir, Bool_t zip){ // // idir - input directory // odir - output directory // files - the list of files to be coppied // zip - not supported yet // // Example : // // idir ="root://gsiaf.gsi.de:1094//sma/sim/v4-05-Rev-03/pp/0000"; // odir ="root://lxgrid2.gsi.de:1094//miranov/test/pp/0000"; // char *files="AliESDs.root AliESDfriend.root Kinematics.root"; --- diff --git a/TPC/macros/AliXRDPROOFtoolkit.cxx b/TPC/macros/AliXRDPROOFtoolkit.cxx index 6b04d07a228..7eb9fd2fba4 100644 --- a/TPC/macros/AliXRDPROOFtoolkit.cxx +++ b/TPC/macros/AliXRDPROOFtoolkit.cxx @@ -578,10 +578,40 @@ void AliXRDPROOFtoolkit::CheckFiles (const char*fileIn, UInt_t checkLevel, const fout.Close(); focGood.close(); focBad.close(); - + } +Bool_t AliXRDPROOFtoolkit::XRDCopyDir(const char * idir, const char * files, const char *odir, Bool_t zip){ + // + // idir - input directory + // odir - output directory + // files - the list of files to be coppied + // zip - not supported yet + // + // Example : + // + // idir ="root://gsiaf.gsi.de:1094//sma/sim/v4-05-Rev-03/pp/0000"; + // odir ="root://lxgrid2.gsi.de:1094//miranov/test/pp/0000"; + // char *files="AliESDs.root AliESDfriend.root Kinematics.root"; + TString str(files); + TObjArray * array = str.Tokenize(" "); + Int_t nfiles = array->GetEntries(); + char infile[1000]; + char outfile[1000]; + char command[20000]; + Bool_t succes=kTRUE; + for (Int_t ifile =0; ifileAt(ifile)->GetName()); + sprintf(outfile,"%s/%s", odir, array->At(ifile)->GetName()); + printf("%s - %s\n",infile, outfile); + Bool_t result = TFile::Cp(infile,outfile); + succes &= result; + } + return succes; +} + + diff --git a/TPC/macros/AliXRDPROOFtoolkit.h b/TPC/macros/AliXRDPROOFtoolkit.h index 90b79a2ed68..58382f0a48e 100644 --- a/TPC/macros/AliXRDPROOFtoolkit.h +++ b/TPC/macros/AliXRDPROOFtoolkit.h @@ -36,6 +36,11 @@ class AliXRDPROOFtoolkit : public TObject // Interface for users with privileges - Possible to use lsrun command // Bool_t ListOfFiles(const char*fileName, const char*path, const char*filter, Bool_t displayMachine); + // + // + Bool_t XRDCopyDir(const char * idir, const char * files, const char *odir, Bool_t zip); + + // // Interface for users with ssh access to the machines // @@ -44,7 +49,7 @@ class AliXRDPROOFtoolkit : public TObject TTree * DumpSys(Bool_t verbose=kTRUE); TTree * DumpSys2(Bool_t verbose=kTRUE); TTree * DumpFiles(Bool_t verbose=kTRUE); - // + // void CheckFiles (const char*fileIn, UInt_t checkLevel, const char*treeToRetrieve, const char*varexp, const char*selection); void AddMachine (const char*name); Int_t fVerbose; // verbso mode - print command