获取文件的 HDF5 文件格式版本

Obtain the HDF5 file format version of a file

给定某个 HDF5 文件 (HDF5 format),我如何知道用于创建它的文件格式的版本?

上下文。在 documentation 中说,当您 create/write 一个文件时,以下库适用于向后兼容:

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.

我尝试过像 h5stat 这样的工具,但它没有输出我想要的信息。

谢谢。

这是上一题的答案https://ftp.hdfgroup.org/hdf5-quest.html#h5dumpvers

问:能否在 h5dump 或 h5ls 中添加一个选项来打印文件的版本?

A:不,我们不打算添加此选项。用户应该使用属性来指定文件的版本。我们不应该添加这个的原因有很多。例如,文件中的不同对象可以由不同版本的库创建或修改。