MD5 sum on a ROOT file; do ROOT files have timestamps?


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.22
Platform: Not Provided
Compiler: Not Provided


I have a code pipeline that I would like to include in CI testing (like through Travis-CI). The culmination of this data analysis pipeline results in a root file that stores basic event-type data.

In order to check the output in a controlled situation I would like to submit a controlled input and then check that the output is exactly the same. The easiest way to do this would be through an md5 sum on the resulting root file.

When this is tried it seems as if the md5 sum of the root file is different despite giving the pipeline program the same input and trying to ensure that the code uses (for example) the same random seed for all random numbers.

This brings about the simple question: do root files have timestamps or any other metadata that would naturally change with time and make this method invalid? And is there a way to suppress that metadata?

Indeed, ROOT files normally do contain changing bits like timestamp and UUID. However, you can create reproducible ROOT files with

TFile *f = TFile::Open("name.root?reproducible","RECREATE","File title");

This feature requires at least ROOT 6.20.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.