Adding many root-files to one

Dear Rootes,

I have the following problem (macro attached). When trying to add many files (approx. 2000) with my macro I receive the following error message:

SysError in TFile::TFile: file File_156.root can not be opened for reading (Too many open files)
SysError in TFile::TFile: file File_157.root can not be opened for reading (Too many open files)
aso

Is there a better way to solve this problem? Thanks a lot in advance.

Best regards,

Michael
MergeFiles.C (1.58 KB)

Hi,

The operating has a limit (cutomizable) of the number of files you can open at the same time. To work around the issue, you are going to have to merge fewer files at a time.

Cheers,
Philippe.

Hi Philipp,

Thanks a lot for your answer.

Is there no easier way or a workaround for that instead adding first a small bunch and then add the fewer ones together?

Thanks.

Cheers,

Michael

Hi Michael,

Unfortunately, this currently the only solution (If you happen to improve TFileMerger to support this case, we will be happy to incorporate your patch :slight_smile: ).

Cheers,
Philippe.

Hi Philippe,

Let’s see maybe I will find a workaround.

Cheers,

Michael