Getting File Name from THashList

Sorry if this is an easy question or answered elsewhere, I looked around quite a bit and still have not found a solution.

I am trying to retrieve file names from a THashList created from a TFileCollection and remove files from the list based on their file name. My current code looks like:

TFileCollection fc(“fc”,“list of input files”, “input.txt”);
THashList * hList = fc.GetList();
TIterator * iter = hList->MakeIterator();
TObject * obj = iter->Next();
TString tempFileName = obj->GetName();

However, instead of getting a file name, I am instead getting something that looks like
48812ef6-955c-11e1-8001-05034082beef

I assume that this is because I’m using a hash list, however I’m not sure how to use this information to recover the file name. Any help would be greatly appreciated.

Hi,

The hash list of a TFileCollection contains objects of type ‘TFileInfo’ (see root.cern.ch/root/html/TFileInfo.html)
and to get the (first url alternative), you should use something like:TString tempFileName = ((TFileInfo*)obj)->GetFirstUrl()->GetUrl();

Cheers,
Philippe.