921 |
contents->SetOwner(); |
contents->SetOwner(); |
922 |
|
|
923 |
// char *fullpath; |
// char *fullpath; |
924 |
const char *fullpath; |
// const char *fullpath; |
925 |
|
|
926 |
// if no input file list is given: |
// if no input file list is given: |
927 |
if ( flisttxt != "" ){ |
if ( flisttxt != "" ){ |
928 |
|
|
929 |
// if( !gSystem->IsFileInIncludePath(flisttxt,&fullpath) ){ |
// if( !gSystem->IsFileInIncludePath(flisttxt,&fullpath) ){ |
930 |
if( !(fullpath = gSystem->FindFile("./",flisttxt)) ){ |
// if( !(fullpath = gSystem->FindFile("./",flisttxt)) ){ |
931 |
cout <<"File "<<flisttxt<<" not found"<<endl; |
// cout <<"File "<<flisttxt<<" not found"<<endl; |
932 |
return 0; |
// return 0; |
933 |
} |
// } |
934 |
// flisttxt = gSystem->ConcatFileName(gSystem->DirName(flisttxt),gSystem->BaseName(flisttxt)); |
// flisttxt = fullpath; |
935 |
flisttxt = fullpath; |
|
936 |
|
flisttxt = gSystem->ConcatFileName(gSystem->DirName(flisttxt),gSystem->BaseName(flisttxt)); |
937 |
|
|
938 |
if( !gSystem->ChangeDirectory(ddir) ){ |
if( !gSystem->ChangeDirectory(ddir) ){ |
939 |
cout << "Cannot change directory : "<<ddir<<endl; |
cout << "Cannot change directory : "<<ddir<<endl; |
943 |
cout <<"Input file list : " << flisttxt <<endl; |
cout <<"Input file list : " << flisttxt <<endl; |
944 |
ifstream in; |
ifstream in; |
945 |
in.open(flisttxt, ios::in); //open input file list |
in.open(flisttxt, ios::in); //open input file list |
946 |
|
if(!in.good()){ |
947 |
|
cout <<" ERROR opening the file "<<endl; |
948 |
|
gSystem->ChangeDirectory(wdir); // back to the working directory |
949 |
|
return 0; |
950 |
|
} |
951 |
int line=0; |
int line=0; |
952 |
while (1) { |
while (1) { |
953 |
TString file; |
TString file; |
962 |
if(file.Contains("#"))file = file(0,file.First("#")); |
if(file.Contains("#"))file = file(0,file.First("#")); |
963 |
// cout <<"(2) " << file << endl; |
// cout <<"(2) " << file << endl; |
964 |
// if( gSystem->IsFileInIncludePath(file,&fullpath) ){ |
// if( gSystem->IsFileInIncludePath(file,&fullpath) ){ |
965 |
if( (fullpath = gSystem->FindFile(ddir,file)) ){ |
// if( (fullpath = gSystem->FindFile(ddir,file)) ){ |
966 |
|
char *fullpath = gSystem->ConcatFileName(gSystem->DirName(ddir),gSystem->BaseName(file)); |
967 |
contents->Add(new TSystemFile(fullpath,gSystem->DirName(fullpath)));// add file to the list |
contents->Add(new TSystemFile(fullpath,gSystem->DirName(fullpath)));// add file to the list |
968 |
|
delete fullpath; |
969 |
}else{ |
// }else{ |
970 |
// if(file.Data()!="")cout << "File: "<<file<<" ---> missing "<< endl; |
// if(file.Data()!="")cout << "File: "<<file<<" ---> missing "<< endl; |
971 |
}; |
// }; |
972 |
}; |
}; |
973 |
in.close(); |
in.close(); |
974 |
|
|
990 |
while ( (questo = (TSystemFile*) next()) ) { |
while ( (questo = (TSystemFile*) next()) ) { |
991 |
TString name = questo-> GetName(); |
TString name = questo-> GetName(); |
992 |
if( name.EndsWith(".root") ){ |
if( name.EndsWith(".root") ){ |
993 |
const char *fullpath = gSystem->FindFile(ddir,name); |
// const char *fullpath = gSystem->FindFile(ddir,name); |
994 |
// char *fullpath; |
// char *fullpath; |
995 |
// gSystem->IsFileInIncludePath(name,&fullpath); |
// gSystem->IsFileInIncludePath(name,&fullpath); |
996 |
|
char *fullpath = gSystem->ConcatFileName(gSystem->DirName(ddir),gSystem->BaseName(name)); |
997 |
contents->Add(new TSystemFile(fullpath,gSystem->DirName(fullpath))); |
contents->Add(new TSystemFile(fullpath,gSystem->DirName(fullpath))); |
998 |
|
delete fullpath; |
999 |
}; |
}; |
1000 |
} |
} |
1001 |
delete temp; |
delete temp; |
1005 |
gSystem->ChangeDirectory(wdir); // back to the working directory |
gSystem->ChangeDirectory(wdir); // back to the working directory |
1006 |
// cout << endl << "Selected files:" << endl; |
// cout << endl << "Selected files:" << endl; |
1007 |
// contents->Print(); |
// contents->Print(); |
1008 |
cout << contents->GetEntries()<<" files selected\n"; |
cout << contents->GetEntries()<<" files \n"; |
1009 |
// cout << endl; |
// cout << endl; |
1010 |
// cout << "Working directory: "<< gSystem->WorkingDirectory()<< endl; |
// cout << "Working directory: "<< gSystem->WorkingDirectory()<< endl; |
1011 |
return contents; |
return contents; |