Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print clear error if a user is tryng to load a .mat file version < 7.3 #84

Open
traversaro opened this issue Aug 9, 2024 · 0 comments

Comments

@traversaro
Copy link
Contributor

Probably we can check if the .mat file is supported by looking at the starting bytes of the file, see:

def is_hdf5(file_path):
    with open(file_path, 'rb') as f:
        signature = f.read(8)
    return signature == b'\x89HDF\r\n\x1a\n'

Based on https://docs.hdfgroup.org/hdf5/v1_14/_f_m_t3.html#Superblock, it seems that this indeed a way to quickly check if a given file is hdf5 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant