|
Re: write a root group to HDF5 file [message #54112 is a reply to message #54104] |
Mon, 21 May 2007 12:07  |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
Klemens wrote:
> Hello together,
>
> I would like to write a root group to a HDF5 file with just some
> attributes but no datasets in it.
> I tried it with H5G_Create and the name "/" but this does not work.
> Is it possible with H5_Create and the right combination of
> structures ? How do the structures have to look like ?
According to the HDF5 online User's Guide <http://hdfgroup.com/HDF5/
doc/UG/>, "The root group is automatically created when the HDF5 file
is created (H5Fcreate)." Therefore, you don't need to create it. All
you need to do is open it:
root_group_id = H5G_open(file_id, '/')
To attach an attribute to the root group:
attr_id = H5A_CREATE(root_group_id, datatype_id, data_space_id)
|
|
|