HDF5: internal timestamps prevent having a fixed hash for an unvarying set of saved objects
@sgougeon)
Reported by Samuel GOUGEON (BUG DESCRIPTION:
----------------
When one saves several times at different datetimes a given set of unchanging objects in .sod = hdf5 encoding, getmd5() varies from file to file. This prevents using save()+getmd5() to know if something has changed in objects (that may be numerous and complex):
https://www.mail-archive.com/dev@lists.scilab.org/msg00422.html
This behavior looks to be due to the HDF5 default format, including some version control. This issue as well arose in Python:
http://stackoverflow.com/questions/16019656/hdf5-file-h5py-with-version-control-hash-changes-on-every-save
Scilab would need as well an option to cancel HDF5 version control when needed:
* with save()
* with h5open()
or for both.
HOW TO REPRODUCE THE BUG:
-------------------------
a = 1;
save(TMPDIR+"/test.sod", "a")
sleep(1000) // the timestamp's resolution is 1s
save(TMPDIR+"/test2.sod", "a")
getmd5(TMPDIR+"/test.sod")
getmd5(TMPDIR+"/test2.sod")
-->getmd5(TMPDIR+"/test.sod")
ans =
a3ab3688298bfbe425a42aaf67860cbc
-->getmd5(TMPDIR+"/test2.sod")
ans =
4caaec6637a089349af687c089ff8c1e
Edited by Vincent COUVERT