H5copy; how to copy root '/' attributes to target file?


#1

Hi,
I want to copy a source h5 file to a new empty file using the command:
h5copy.exe -i "input path"' -o "output path" -s "item name" -d "item name"

After run, I found that all items and their attributes are copied to output file except the attributes of root ‘/’ in source h5 file.

How can I copy the attributes of root ‘/’ ? Thanks.


#2

I believe this is a bug. Please contact the HelpDesk and file a bug report.

If you want to copy to a

why not copy the whole file?

What are the types of those root-group attributes? You could write a little Python script (get an iterator from the .attrs attribute manager of the root group) to copy the attributes.

G.


#3

This is because the source h5 file has been edited multiple times and the file size increased although the content is decreased. I have used h5pack.exe to compact the file instead. I thought the h5copy.exe is more versatile because it allows selective copy and allows merged copy to another file.


#4

I see. Doing tool-based freespace management is tedious. Depending on your version constraints, in HDF5 1.10+ freespace management has gotten a lot better. fsm.c (3.3 KB)
Have a look at the attached example and let us know if that works for you. G.