I am looping over 1300 directories using the attached function.
This is done by reading a FileList.txt that contains the directories.
The strange thing is that I can loop over directory 1-990 Then it
stops working. It simply does not go beyond line if(files){
Meaning it something related to the line TList *files = dir.GetListOfFiles();
If on the other hand I start a new list that begins with
directory 990 it works fine. which is my quick fix for this.
Any thoughts to what could be the reason this is?
[code]TString list_files(const char *dirname, const char *ext,TString &fname1)
{
TSystemDirectory dir(dirname, dirname);
cout << dirname <<" " << ext << endl;
TList *files = dir.GetListOfFiles();
/////
if(files) {
cout << "listfile is used: " << endl;
TSystemFile file;
TIter next(files);
TString fname;
while ((file=(TSystemFile)next())) {
fname = file->GetName();
if (!file->IsDirectory() && fname.EndsWith(ext)) {
fname1 =fname;
cout <<“here:”<< fname1 << endl;
}
}
}
//files->Delete();
return fname1;
}
void main() {
//loop over directories using a while loop
while(true) {
open the filelist.txt
list_files(eventDir.Data(),“f.root”,rootFilename);
}
}[/code]