Dear Experts !
I have few directories p_1,p_2,p_3,p_4…p_n and each directory contains a number of root files. I want to read all root files from all the directories. Off course I can read all the files from one directory but how do I loop over all the directories.
You can use your logic to list the entries of a directory to browse into the sub directories, too. For a given entry in a directory, you can use the following code to see if it is a directory or a file
FileStat_t statBuf;
int retval = gSystem->GetPathInfo(path /* base directory + / + current entry */, statBuf);
R__ASSERT(retval == 0);
if (R_ISDIR(statBuf.fMode)) {
// Browse sub directory
}