I\'m trying to save an array as a HDF5 file using R, but having no luck.
To try and diagnose the problem I ran example(hdf5save)
. This successfully crea
I've also run into the same issue and found a reasonable fix.
The issue seems like it stems from when the hdf5 library finalizes the file. If it doesn't get a chance to finalize the file, then the file is corrupted. I think this happens after the buffer is flushed but the buffer doesn't always flush.
One solution I've found is to do the hdf5save in a separate function. Assign the variables into the globalenv(), then call hdf5save and exit the function. When the function completes, the memory seems to clean up which makes the hdf5 libarary flush the buffer and finalize the file.
Hope this helps!