2

Given a certain HDF5 file (HDF5 format), how can I know the version of the file format that has been used for its creation?

Context. It is said in the documentation that when you create/write a file the library the following applies for backward compatibility:

An HDF5 Library of any given release is designed to read all existing HDF5 files from that or any prior release. Although major versions sometimes contain features that require additions and/or changes to the HDF5 file format, the library will by default write out files that conform to a maximum compatibility principle. That is, files are written with the earliest version of the file format that describes the information, rather than always using the latest version possible. This provides the best forward compatibility by allowing the maximum number of older versions of the library to read new files.

I have tried tools like h5stat but it does not output the info that I want.

Thank you.

pablo_worker
  • 1,042
  • 9
  • 26
  • you mean the hdf5 library version? i think all the programs use the same xc library anyway – kakk11 May 24 '17 at 16:00
  • @kakk11 I mean, if a hdf5 file is created using the hdf5 library version 1.10.x I will be able to open it with a program that has the library version 1.8.x if the file doesn't have any features of the version 1.10.x. However, without trying to open it with my program, can I know in advance the minimum library version that it is needed? – pablo_worker May 25 '17 at 06:29

1 Answers1

1

Here is an answer in the last question https://ftp.hdfgroup.org/hdf5-quest.html#h5dumpvers

Q: Can you add an option to h5dump or h5ls to print the version of a file ?

A: No, we do not plan on adding this option. Users should use attributes to specify the version of a file. There are many reasons why we shouldn't add this. For example, different objects in the file could be created or modified by different versions of the library.

kakk11
  • 898
  • 8
  • 21
  • Thanks. However, I'm not sure if they are speaking about a custom parameter that the user can use to specify the version of a file, or about the version of the HDF5 library. – pablo_worker May 25 '17 at 13:50
  • 2
    Well the last sentence is clear about the possibility of different library versions used to write the same file, so I understand it is users duty to write down what library version is compatible with the file. That said, I do not agree with HDF5 groups opinion and I believe the feature of compatibility check of library versions, could be beneficial for the user and would not be that hard to implement. – kakk11 May 26 '17 at 06:06