Page tree

The license could not be verified: License Certificate has expired!

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »









Creates a new empty group and links it to a location in the file

This function is renamed from H5G_CREATE and deprecated in favor of the functions H5G_CREATE2 and H5G_CREATE_ANON, or the new macro H5G_CREATE.


H5G_CREATE1(loc_id, name, size_hint)


hid_t H5Gcreate1( hid_t loc_id, const char *name, size_t size_hint )

hid_t loc_idIN: Location identifier; may be a file, group, dataset, named datatype or attribute
const char *nameIN: Absolute or relative name of the new group
size_t size_hint    

IN: Optional parameter indicating the number of bytes to reserve for the names that will appear in the group

A conservative estimate could result in multiple system-level I/O requests to read the group name heap; a liberal estimate could result in a single large I/O request even when the group has just a few names. HDF5 stores each name with a null terminator.


H5G_CREATE1 creates a new group with the specified name at the specified location, loc_idloc_id may be a file, group, dataset, named datatype or attribute.  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. The name, name, must not already be taken by some other object and all parent groups must already exist.

name can be a relative path based at loc_id or an absolute path from the root of the file. Use of this function requires that any intermediate groups specified in the path already exist.

The length of a group name, or of the name of any object within a group, is not limited.

size_hint is a hint for the number of bytes to reserve to store the names which will be eventually added to the new group. Passing a value of zero for size_hint is usually adequate since the library is able to dynamically resize the name heap, but a correct hint may result in better performance. If a non-positive value is supplied for size_hint, then a default size is chosen.

The return value is a group identifier for the open group. This group identifier should be closed by calling H5G_CLOSE when it is no longer needed.

See H5G_CREATE_ANON for a discussion of the differences between H5G_CREATE1 and H5G_CREATE_ANON.


Returns a valid group identifier for the open group if successful; otherwise returns a negative value. 


Release    Change
1.8.0Function H5Gcreate renamed to H5Gcreate1 and deprecated in this release.

--- Last Modified: August 13, 2019 | 08:33 AM