Loop over subdirectories

Greetings rooters,
Is there a simple way using root to loop over all subdirectories in a directory.
Thanks

Yes.
Python:

import os
for dirName in os.listdir("path/to/the/dir"):
    print dirName

in ROOT via the C++ interface:

TSystemDirectory dir("MyDir", "path/to/the/dir");
auto files = dir.GetListOfFiles();
for (auto fileObj : *files)  {
   auto file = (TSystemFile*) fileObj;
   std::cout << file->GetName() << std::endl;
}

Danilo