Check if TObject exists in TFile

Hello and thank you in advance for your help.

How can I check via macro if a TObject with a given name already exists in a TFile?

Thanks :slight_smile:

Try: TDirectoryFile::FindObjectAny(const char* name)

Thank you! I actually didn’t need to use it anymore, but it looks like what I was looking for.