Skip to content

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

@traversaro

Description

@traversaro

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 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions