HDF5  1.13.0
H5G

Group Interface. More...

Functions

hid_t H5Gcreate2 (hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id)
 Creates a new group and links it into the file. More...
 
hid_t H5Gopen2 (hid_t loc_id, const char *name, hid_t gapl_id)
 Opens an existing group in a file. More...
 
herr_t H5Gclose (hid_t group_id)
 Closes the specified group. More...
 

Detailed Description

Group Interface.

Todo:
Describe concisely what the functions in this module are about.

Function Documentation

◆ H5Gclose()

herr_t H5Gclose ( hid_t  group_id)

Closes the specified group.

Parameters
[in]group_idGroup identifier
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Gclose() releases resources used by a group which was opened by H5Gcreate() or H5Gopen() After closing a group, group_id cannot be used again until another H5Gcreate() or H5Gopen() is called on it.

Failure to release a group with this call will result in resource leaks.

Since
1.8.0
See also
H5Gcreate2(), H5Gopen2()

◆ H5Gcreate2()

hid_t H5Gcreate2 ( hid_t  loc_id,
const char *  name,
hid_t  lcpl_id,
hid_t  gcpl_id,
hid_t  gapl_id 
)

Creates a new group and links it into the file.

Parameters
[in]loc_idLocation identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute.
[in]nameName of the group to create
[in]lcpl_idLink creation property list identifier
[in]gcpl_idGroup creation property list identifier
[in]gapl_idGroup access property list identifier
Returns
Returns a group identifier if successful; otherwise returns H5I_INVALID_HID.

H5Gcreate2() creates a new group in a file. After a group has been created, links to datasets and to other groups can be added.

The loc_id and name parameters specify where the group is located. loc_id may be a file, group, dataset, named datatype or attribute in the file. If an attribute, dataset, or named datatype is specified for loc_id then the group will be created at the location where the attribute, dataset, or named datatype is attached. name is the link to the group; name may be either an absolute path in the file (the links from the root group to the new group) or a relative path from loc_id (the link(s) from the group specified by loc_id to the new group).

lcpl_id, gcpl_id, and gapl_id are property list identifiers. These property lists govern how the link to the group is created, how the group is created, and how the group can be accessed in the future, respectively. H5P_DEFAULT can be passed in if the default properties are appropriate for these property lists. Currently, there are no APIs for the group access property list; use H5P_DEFAULT.

To conserve and release resources, the group should be closed when access is no longer required.

Since
1.8.0
See also
H5Gopen2(), H5Gclose()

◆ H5Gopen2()

hid_t H5Gopen2 ( hid_t  loc_id,
const char *  name,
hid_t  gapl_id 
)

Opens an existing group in a file.

Parameters
[in]loc_idLocation identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute.
[in]nameName of the group to open
[in]gapl_idGroup access property list identifier
Returns
Returns a group identifier if successful; otherwise returns H5I_INVALID_HID.

H5Gopen2() opens an existing group, name, at the location specified by loc_id.

With default settings, H5Gopen2() provides similar functionality to that provided by H5Gopen(). The only difference is that H5Gopen2() can provide a group access property list, gapl_id.

H5Gopen2() returns a group identifier for the group that was opened. This group identifier should be released by calling H5Gclose() when it is no longer needed.

Since
1.8.0
See also
H5Gcreate2(), H5Gclose()