Just to be clear, the answer to the original question is yes, you definitely should be able to open an .h5 file generated by h5py and read it in Julia with HDF5.jl.
@mkitti is correctly showing you how to read the “file signature” (aka, “magic bytes” or “magic number”). Most common file formats begin with several specific bytes to help identify the format. HDF5 uses \x89HDF\r\n\x1a\n
. A gzipped file (even a .tar.gz) would start with \x1F\x8B
. And so on.
The fact that your files don’t start with \x89HDF\r\n\x1a\n
means they are not valid HDF5 files. HDF4’s magic number is \x0e\x03\x13\x01
, so your files aren’t in HDF4. In fact, I can’t find any file format that starts with either of your strings.
I suspect that your colleague failed to write the file correctly. For example, they might have forgotten to close the file. Note that it’s better to use context managers in python:
with h5py.File("results.h5", "w") as f:
dset = f.create_dataset("mydataset", (100,), dtype='i')
This automatically closes the file.
You could prove that it isn’t a problem on the Julia side by using h5py to try to read the file:
with h5py.File("/path/to/data/results.h5", "r") as f:
list(f)
I bet you get an error like
OSError: Unable to synchronously open file (file signature not found)