Same root file, different file size

This question is only due to curiosity. I do not have an actual problem.

I have some piece of code that creates a flat n-tuple. I ran this code twice and get two root files. For all I can tell, these root files are exactly the same, as is expected. However, the file size of the two files is different. The difference is very small (half a permille), but they are different nonetheless. I ran the code a third time, and get a different file size again. What could be the reason for this?

Hi Basil,

this is a feature of the way files are stored on disk not of ROOT: see for example https://unix.stackexchange.com/questions/106275/du-gives-two-different-results-for-the-same-file

Hope this helps,
D

Hi D

Thank you for your reply. However, I’m not using du. Also, using md5sum or sha1sum reveals, that the files indeed are different.

Hi Basil,

Differences will be due to the time stamp that’s stored with each key (i.e. “entry” in the file) and could be due to uninitialized members of the objects you store in the file, and a GUID that’s part of some files (TProcessID), depending on what you store. I might be forgetting other sources of changes in size.

Cheers, Axel.

Hi Axel

Thanks. That makes sense. I hope to not store anything uninitialized, but the time stamp will be different of course.

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