I want to copy whole .h5 file to new file due to library version issue in using MATLAB. But I have a problem: my .h5 data file contains some datasets and groups in root directory, and I tried to copy it using h5py:
originfile = h5py.File('file_0.raw.h5', 'r')
convertedfile = h5py.File('file_0.raw_conv.h5', 'w', libver=('earliest', 'v108'))
originfile.copy('/', convertedfile, name='/')
originfile.close()
convertedfile.close()
It doesn't work.. with error
RuntimeError: Unable to copy object (destination object already exists)
Can I copy in another way to avoid this error?