File System Control in Root


I am currently trying to combine the results of running an analysis script on ultiple input files, each of which results in the creation of a .root file in a separate directory. Is there any way from within Root to loop over the operating system’s directory structure?


Yes, use the TSystem class

where TUnixSystem is a TSystem and the singleton pointed by gSystem.

In particular look at

//---- Directories virtual void *OpenDirectory(const char *name); virtual void FreeDirectory(void *dirp); virtual const char *GetDirEntry(void *dirp); virtual void *GetDirPtr() const { return 0; }