![]() |
HDF5
1.13.0
|
Group Interface. More...
Functions | |
herr_t | H5Gclose (hid_t group_id) |
Closes the specified group. More... | |
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 | H5Gcreate_anon (hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) |
Creates a new empty group without linking it into the file structure. More... | |
herr_t | H5Gflush (hid_t group_id) |
Flushes all buffers associated with a group to disk. More... | |
hid_t | H5Gget_create_plist (hid_t group_id) |
Gets a group creation property list identifier. More... | |
herr_t | H5Gget_info (hid_t loc_id, H5G_info_t *ginfo) |
Retrieves information about a group. More... | |
herr_t | H5Gget_info_by_idx (hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5G_info_t *ginfo, hid_t lapl_id) |
Retrieves information about a group, according to the group’s position within an index. More... | |
herr_t | H5Gget_info_by_name (hid_t loc_id, const char *name, H5G_info_t *ginfo, hid_t lapl_id) |
Retrieves information about a group by its name. 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 | H5Grefresh (hid_t group_id) |
Refreshes all buffers associated with a group. More... | |
hid_t | H5Gcreate1 (hid_t loc_id, const char *name, size_t size_hint) |
Creates a new empty group and links it to a location in the file. More... | |
int | H5Gget_comment (hid_t loc_id, const char *name, size_t bufsize, char *buf) |
Retrieves comment from an object. More... | |
herr_t | H5Gget_linkval (hid_t loc_id, const char *name, size_t size, char *buf) |
Retrieves the name of the object that the symbolic link points to. More... | |
herr_t | H5Gget_num_objs (hid_t loc_id, hsize_t *num_objs) |
Returns number of objects in the group. More... | |
herr_t | H5Gget_objinfo (hid_t loc_id, const char *name, hbool_t follow_link, H5G_stat_t *statbuf) |
Returns information about an object. More... | |
ssize_t | H5Gget_objname_by_idx (hid_t loc_id, hsize_t idx, char *name, size_t size) |
Returns a name of an object specified by an index (deprecated) More... | |
H5G_obj_t | H5Gget_objtype_by_idx (hid_t loc_id, hsize_t idx) |
Returns the type of an object specified by an index. More... | |
herr_t | H5Giterate (hid_t loc_id, const char *name, int *idx, H5G_iterate_t op, void *op_data) |
Iterates an operation over the entries of a group. More... | |
herr_t | H5Glink (hid_t cur_loc_id, H5L_type_t type, const char *cur_name, const char *new_name) |
Creates a link between two existing objects. More... | |
herr_t | H5Glink2 (hid_t cur_loc_id, const char *cur_name, H5L_type_t type, hid_t new_loc_id, const char *new_name) |
Creates a link between two existing objects. More... | |
herr_t | H5Gmove (hid_t src_loc_id, const char *src_name, const char *dst_name) |
Renames an object within an HDF5 file. More... | |
herr_t | H5Gmove2 (hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name) |
Renames an object within an HDF5 file. More... | |
hid_t | H5Gopen1 (hid_t loc_id, const char *name) |
Opens an existing group for modification. More... | |
herr_t | H5Gset_comment (hid_t loc_id, const char *name, const char *comment) |
Sets comment for specified object. More... | |
herr_t | H5Gunlink (hid_t loc_id, const char *name) |
Removes the link to an object from a group. More... | |
Group Interface.
Closes the specified group.
[in] | group_id | Group identifier |
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.
Creates a new empty group and links it to a location in the file.
[in] | loc_id | Location identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute. |
[in] | name | Absolute or relative name of the group to create |
[in] | size_hint | Optional parameter indicating the number of bytes to reserve for the name of the new group |
H5Gcreate1() creates a new group with the specified name at the specified location, loc_id
.
loc_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. 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. 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 H5Gclose() when it is no longer needed.
See H5Gcreate_anon() for a discussion of the differences between H5Gcreate1 and H5Gcreate_anon().
[in] | loc_id | Location identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute. |
[in] | name | Absolute or relative name of the group to create |
[in] | size_hint | Optional parameter indicating the number of bytes to reserve for the name of the new group |
H5Gcreate1() creates a new group with the specified name at the specified location, loc_id
.
loc_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. 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. 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 H5Gclose() when it is no longer needed.
See H5Gcreate_anon() for a discussion of the differences between H5Gcreate1 and H5Gcreate_anon().
Creates a new group and links it into the file.
[in] | loc_id | Location identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute. |
[in] | name | Name of the group to create |
[in] | lcpl_id | Link creation property list identifier |
[in] | gcpl_id | Group creation property list identifier |
[in] | gapl_id | Group access property list identifier |
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.
The group identifier should be closed by H5Gclose() when access is no longer required to prevent resource leaks.
Creates a new empty group without linking it into the file structure.
[in] | loc_id | Location identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute. |
[in] | gcpl_id | Group creation property list identifier |
[in] | gapl_id | Group access property list identifier |
H5Gcreate_anon() creates a new empty group in the file specified by loc_id
. With default settings, H5Gcreate_anon() provides similar functionality to that provided by H5Gcreate1(), with the differences described in the list below.
The new group’s creation and access properties are specified in gcpl_id
and gapl_id
, respectively.
H5Gcreate_anon() returns a new group identifier. This identifier must be linked into the HDF5 file structure with H5Olink() or it will be deleted from the file when the file is closed.
The differences between this function and H5Gcreate1() are as follows:
gcpl_id
through a H5Pset_local_heap_size_hint() call.A group created with this function should be closed with H5Gclose() when the group is no longer needed so that resource leaks will not develop.
Flushes all buffers associated with a group to disk.
[in] | group_id | Group identifier |
H5Gflush() causes all buffers associated with a group to be immediately flushed to disk without removing the data from the cache.
int H5Gget_comment | ( | hid_t | loc_id, |
const char * | name, | ||
size_t | bufsize, | ||
char * | buf | ||
) |
Retrieves comment from an object.
[in] | loc_id | Location identifier. The identifier may be that of a file, group, dataset, or named datatype. |
[in] | name | Name of the object whose comment is to be retrieved |
[in] | bufsize | Size of buf |
[out] | buf | Buffer for the comment |
H5Gget_comment() retrieves the comment for the the object specified by loc_id
and name. The comment is returned in the buffer comment
.
loc_id
can specify any object in the file. name
can be one of the following:
H5Gget_comment() returns the number of characters in the comment, counting the null terminator, if successful. The value returned may be larger than bufsize
.
At most bufsize characters, including a null terminator, are returned in comment. The returned value is not null terminated if the comment is longer than the supplied buffer. If the size of the comment is unknown, a preliminary H5Gget_comment() call will return the size of the comment, including space for the null terminator.
If an object does not have a comment, an empty string is returned in comment.
Gets a group creation property list identifier.
[in] | group_id | Group identifier |
H5Gget_create_plist() returns an identifier for the group creation property list associated with the group specified by group_id
.
The creation property list identifier should be released with H5Gclose() to prevent resource leaks.
herr_t H5Gget_info | ( | hid_t | loc_id, |
H5G_info_t * | ginfo | ||
) |
Retrieves information about a group.
[in] | loc_id | Location identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute. |
[out] | ginfo | Struct in which group information is returned |
H5Gget_info() retrieves information about the group at location specified by loc_id
. The information is returned in the ginfo
.
ginfo
is an H5G_info_t struct and is defined (in H5Gpublic.h) as follows:
Possible values of storage_type
are:
H5G_STORAGE_TYPE_COMPACT | Compact storage |
H5G_STORAGE_TYPE_DENSE | Indexed storage |
H5G_STORAGE_TYPE_SYMBOL_TABLE | Symbol tables, the original HDF5 structure |
herr_t H5Gget_info_by_idx | ( | hid_t | loc_id, |
const char * | group_name, | ||
H5_index_t | idx_type, | ||
H5_iter_order_t | order, | ||
hsize_t | n, | ||
H5G_info_t * | ginfo, | ||
hid_t | lapl_id | ||
) |
Retrieves information about a group, according to the group’s position within an index.
[in] | loc_id | Location identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute. |
[in] | group_name | Name of the group to query |
[in] | idx_type | Transient index identifying object |
[in] | order | Transient index identifying object |
[in] | n | Position in the index of the group to query |
[out] | ginfo | Struct in which group information is returned |
[in] | lapl_id | Link access property list identifier |
loc_id
and group_name
specify the group containing the group for which information is sought. The groups in group_name
are indexed by idx_type
; the group for which information is retrieved is identified in that index by index order, order
, and index position, n
.
If loc_id
specifies the group containing the group for which information is queried, group_name
can be a dot (.).
Valid values for index_type
are as follows:
H5_INDEX_NAME | Lexicographic order on name |
H5_INDEX_CRT_ORDER | Index on creation order |
The order in which the index is to be examined, as specified by order
, can be one of the following:
H5_ITER_INC | Increasing order |
H5_ITER_DEC | Decreasing order |
H5_ITER_NATIVE | Fastest available order |
herr_t H5Gget_info_by_name | ( | hid_t | loc_id, |
const char * | name, | ||
H5G_info_t * | ginfo, | ||
hid_t | lapl_id | ||
) |
Retrieves information about a group by its name.
[in] | loc_id | Location identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute. |
[in] | name | Name of the group to query |
[out] | ginfo | Struct in which group information is returned |
[in] | lapl_id | Link access property list identifier |
H5Gget_info_by_name() retrieves information about the group name
at location specified by loc_id
. The information is returned in the ginfo
struct.
If loc_id
specifies the group for which information is queried, then the group's name
can be a dot (.).
ginfo
is an H5G_info_t struct and is defined (in H5Gpublic.h) as follows:
Possible values of storage_type
are:
H5G_STORAGE_TYPE_COMPACT | Compact storage |
H5G_STORAGE_TYPE_DENSE | Indexed storage |
H5G_STORAGE_TYPE_SYMBOL_TABLE | Symbol tables, the original HDF5 structure |
Retrieves the name of the object that the symbolic link points to.
[in] | loc_id | Location identifier |
[in] | name | Symbolic link to the object whose name is to be returned |
[in] | size | Size of buf |
[out] | buf | Buffer to hold the name of the object being sought |
H5Gget_linkval() returns size characters of the name of the object that the symbolic link name
points to.
The parameter loc_id
is a file or group identifier.
The parameter name
must be a symbolic link pointing to the desired object and must be defined relative to loc_id
.
If size
is smaller than the size of the returned object name, then the name stored in the buffer value will not be null terminated.
This function fails if name
is not a symbolic link. The presence of a symbolic link can be tested by passing zero for size
and NULL for value
.
This function should be used only after H5Lget_info1() (or the deprecated function H5Gget_objinfo()) has been called to verify that name
is a symbolic link.
Returns number of objects in the group.
[in] | loc_id | Location identifier |
[out] | num_objs | Number of objects in the group |
H5Gget_num_objs() returns number of objects in a group specified by its identifier loc_id
. If a file identifier is passed in, then the number of objects in the root group is returned.
herr_t H5Gget_objinfo | ( | hid_t | loc_id, |
const char * | name, | ||
hbool_t | follow_link, | ||
H5G_stat_t * | statbuf | ||
) |
Returns information about an object.
[in] | loc_id | Location identifier |
[in] | name | Name of the object for which status is being sought |
[in] | follow_link | Link flag |
[out] | statbuf | Buffer in which to return information about the object |
statbuf
(if non-null) assigned with values. Otherwise, returns a negative value.H5Gget_objinfo() returns information about the specified object through statbuf
.
A file or group identifier, loc_id
, and an object name, name
, relative to loc_id
, are commonly used to specify the object. However, if the object identifier is already known to the application, an alternative approach is to use that identifier, obj_id
, in place of loc_id
, and a dot (.) in place of name
. Thus, the alternative versions of the first portion of an H5Gget_objinfo() call would be as follows:
H5Gget_objinfo(loc_id, name, ...) H5Gget_objinfo(obj_id, ".", ...)
If the object is a symbolic link and follow_link
is zero (0), then the information returned describes the link itself; otherwise the link is followed and the information returned describes the object to which the link points. If follow_link
is non-zero but the final symbolic link is dangling (does not point to anything), then an error will be returned. The fields in statbuf
are undefined for an error. The existence of an object can be tested by calling this function with a null statbuf
.
H5Gget_objinfo() fills in the following data structure (defined in H5Gpublic.h):
where H5O_stat_t (defined in H5Opublic.h) is:
The fields fileno
and objno
contain four values which uniquely identify an object among those HDF5 files which are open: if all four values are the same between two objects, then the two objects are the same (provided both files are still open).
fileno
will change. fileno
.nlink
is the number of hard links to the object or zero when information is being returned about a symbolic link (symbolic links do not have hard links but all other objects always have at least one).The field type
contains the type of the object, either of the following: H5G_GROUP, H5G_DATASET, H5G_LINK, or H5G_TYPE.
The field mtime
contains the modification time.
If information is being returned about a symbolic link then linklen
will be the length of the link value (the name of the pointed-to object with the null terminator); otherwise linklen
will be zero.
The fields in the H5O_stat_t
struct contain information about the object header for the object queried:
size The total size of all the object header information in the file (for all chunks). free The size of unused space in the object header. nmesgs The number of object header messages. nchunks The number of chunks the object header is broken up into.
Other fields may be added to this structure in the future.
Some systems will be able to record the time accurately but unable to retrieve the correct time; such systems (e.g., Irix64) will report an mtime value of 0 (zero).
[in] | loc_id | Location identifier |
[in] | name | Name of the object for which status is being sought |
[in] | follow_link | Link flag |
[out] | statbuf | Buffer in which to return information about the object |
statbuf
(if non-null) assigned with values. Otherwise, returns a negative value.H5Gget_objinfo() returns information about the specified object through statbuf
.
A file or group identifier, loc_id
, and an object name, name
, relative to loc_id
, are commonly used to specify the object. However, if the object identifier is already known to the application, an alternative approach is to use that identifier, obj_id
, in place of loc_id
, and a dot (.) in place of name
. Thus, the alternative versions of the first portion of an H5Gget_objinfo() call would be as follows:
H5Gget_objinfo(loc_id, name, ...) H5Gget_objinfo(obj_id, ".", ...)
If the object is a symbolic link and follow_link
is zero (0), then the information returned describes the link itself; otherwise the link is followed and the information returned describes the object to which the link points. If follow_link
is non-zero but the final symbolic link is dangling (does not point to anything), then an error will be returned. The fields in statbuf
are undefined for an error. The existence of an object can be tested by calling this function with a null statbuf
.
H5Gget_objinfo() fills in the following data structure (defined in H5Gpublic.h):
where H5O_stat_t (defined in H5Opublic.h) is:
The fields fileno
and objno
contain four values which uniquely identify an object among those HDF5 files which are open: if all four values are the same between two objects, then the two objects are the same (provided both files are still open).
fileno
will change. fileno
.nlink
is the number of hard links to the object or zero when information is being returned about a symbolic link (symbolic links do not have hard links but all other objects always have at least one).The field type
contains the type of the object, either of the following: H5G_GROUP, H5G_DATASET, H5G_LINK, or H5G_TYPE.
The field mtime
contains the modification time.
If information is being returned about a symbolic link then linklen
will be the length of the link value (the name of the pointed-to object with the null terminator); otherwise linklen
will be zero.
The fields in the H5O_stat_t
struct contain information about the object header for the object queried:
size The total size of all the object header information in the file (for all chunks). free The size of unused space in the object header. nmesgs The number of object header messages. nchunks The number of chunks the object header is broken up into.
Other fields may be added to this structure in the future.
Some systems will be able to record the time accurately but unable to retrieve the correct time; such systems (e.g., Irix64) will report an mtime value of 0 (zero).
Returns a name of an object specified by an index (deprecated)
[in] | loc_id | Location identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute. |
[in] | idx | Transient index identifying object |
[in,out] | name | Buffer for name |
[in] | size | Name length |
idx
at the location specified by loc_id
.loc_id
may be a group or a file, which is the file's root group.
idx
is the transient index used to iterate through the objects in the group. The value of idx
is any nonnegative number less than the total number of objects in the group, which is returned by the function H5Gget_num_objs(). Note that this is a transient index; an object may have a different index each time a group is opened.
The object name is returned in the user-specified buffer name
.
If the size of the provided buffer name
is less or equal the actual object name length, the object name is truncated to size - 1
characters.
Note that if the size of the object's name is unkown, a preliminary call to H5Gget_objname_by_idx() with name set to NULL will return the length of the object's name. A second call to H5Gget_objname_by_idx() can then be used to retrieve the actual name.
Returns the type of an object specified by an index.
[in] | loc_id | Location identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute. |
[in] | idx | Transient index identifying object |
H5Gget_objtype_by_idx() returns the type of the object specified by the index idx
in the group loc_id
. A file identifier may also be passed in for loc_id
; which indicates the file's root group.
idx
is the transient index used to iterate through the objects in the group. This parameter is described in more detail in the discussion of H5Gget_objname_by_idx.
The object type is returned as one of the following values:
H5G_GROUP | 0 | Object is a group |
H5G_DATASET | 1 | Object is a dataset |
H5G_TYPE | 2 | Object is a named datatype |
H5G_LINK | 3 | Object is a symbolic link |
H5G_UDLINK | 4 | Object is a user-defined link |
herr_t H5Giterate | ( | hid_t | loc_id, |
const char * | name, | ||
int * | idx, | ||
H5G_iterate_t | op, | ||
void * | op_data | ||
) |
Iterates an operation over the entries of a group.
[in] | loc_id | Location identifier. The identifier may be that of a file, group, dataset, or named datatype. |
[in] | name | Group over which the iteration is performed |
[in,out] | idx | Location at which to begin the iteration |
[in] | op | Operation to be performed on an object at each iteration |
[in,out] | op_data | Data associated with the operation |
H5Giterate() iterates over the members of the group name
in the file or group specified with loc_id
.
For each object in the group, the op_data
and some additional information, specified below, are passed to the op
function. The iteration begins with the idx'th
object in the group and the next element to be processed by the operator is returned in idx
. If idx
is NULL, then the iterator starts at the first group member; since no stopping point is returned in this case, the iterator cannot be restarted if one of the calls to its operator returns non-zero. H5Giterate() does not recursively follow links into subgroups of the specified group.
The prototype for H5G_iterate_t is:
The operator function receives the group identifier for the group being iterated over, loc_id
, the name of the current object within the group, name
, and the pointer to the operator data passed in to H5Giterate(), op_data
.
The return values from an operator are:
H5Giterate() assumes that the membership of the group identified by name
remains unchanged throughout the iteration. If the membership changes during the iteration, the function's behavior is undefined.
H5Giterate() is not recursive. For example, if a member of name
is found to be a group, call it subgroup_a
, H5Giterate() does not examine the members of subgroup_a
. When recursive iteration is required, the application must handle the recursion, explicitly calling H5Giterate() on discovered subgroups.
herr_t H5Glink | ( | hid_t | cur_loc_id, |
H5L_type_t | type, | ||
const char * | cur_name, | ||
const char * | new_name | ||
) |
Creates a link between two existing objects.
[in] | cur_loc_id | File or group identifier |
[in] | type | Link type |
[in] | cur_name | Current name |
[in] | new_name | New name to link to |
H5Glink() creates a new name for an object that has some current name, possibly one of many names it currently has.
If link_type is H5G_LINK_HARD, then current_name must specify the name of an existing object and both names are interpreted relative to cur_loc_id
, which is either a file identifier or a group identifier.
If link_type
is H5G_LINK_SOFT, then current_name
can be anything and is interpreted at lookup time relative to the group which contains the final component of new_name
. For instance, if current_name
is ./foo
, new_name
is ./x/y/bar
, and a request is made for ./x/y/bar
, then the actual object looked up is ./x/y/./foo
.
[in] | cur_loc_id | File or group identifier |
[in] | type | Link type |
[in] | cur_name | Current name |
[in] | new_name | New name to link to |
H5Glink() creates a new name for an object that has some current name, possibly one of many names it currently has.
If link_type is H5G_LINK_HARD, then current_name must specify the name of an existing object and both names are interpreted relative to cur_loc_id
, which is either a file identifier or a group identifier.
If link_type
is H5G_LINK_SOFT, then current_name
can be anything and is interpreted at lookup time relative to the group which contains the final component of new_name
. For instance, if current_name
is ./foo
, new_name
is ./x/y/bar
, and a request is made for ./x/y/bar
, then the actual object looked up is ./x/y/./foo
.
herr_t H5Glink2 | ( | hid_t | cur_loc_id, |
const char * | cur_name, | ||
H5L_type_t | type, | ||
hid_t | new_loc_id, | ||
const char * | new_name | ||
) |
Creates a link between two existing objects.
[in] | cur_loc_id | The file or group identifier for the original object |
[in] | cur_name | Current name |
[in] | type | Link type |
[in] | new_loc_id | The file or group identifier for the new link |
[in] | new_name | New name |
H5Glink2() creates a new name for an object that has some current name, possibly one of many names it currently has.
If link_type
is H5G_LINK_HARD, then current_name must specify the name of an existing object. In this case, current_name
and new_name
are interpreted relative to curr_loc_id
and new_loc_id
, respectively, which are either file or group identifiers.
If link_type
is H5G_LINK_SOFT, then current_name
can be anything and is interpreted at lookup time relative to the group which contains the final component of new_name
. For instance, if current_name
is ./foo
, new_name
is ./x/y/bar
, and a request is made for ./x/y/bar
, then the actual object looked up is ./x/y/./foo
.
[in] | cur_loc_id | The file or group identifier for the original object |
[in] | cur_name | Current name |
[in] | type | Link type |
[in] | new_loc_id | The file or group identifier for the new link |
[in] | new_name | New name |
H5Glink2() creates a new name for an object that has some current name, possibly one of many names it currently has.
If link_type
is H5G_LINK_HARD, then current_name must specify the name of an existing object. In this case, current_name
and new_name
are interpreted relative to curr_loc_id
and new_loc_id
, respectively, which are either file or group identifiers.
If link_type
is H5G_LINK_SOFT, then current_name
can be anything and is interpreted at lookup time relative to the group which contains the final component of new_name
. For instance, if current_name
is ./foo
, new_name
is ./x/y/bar
, and a request is made for ./x/y/bar
, then the actual object looked up is ./x/y/./foo
.
Renames an object within an HDF5 file.
[in] | src_loc_id | The file or group identifier for the original object |
[in] | src_name | Object's original name |
[in] | dst_name | Object's new name |
H5Gmove() renames an object within an HDF5 file. The original name, src_name
, is unlinked from the group graph and the new name, dst_name
, is inserted as an atomic operation. Both names are interpreted relative to loc_id
, which is either a file or a group identifier.
herr_t H5Gmove2 | ( | hid_t | src_loc_id, |
const char * | src_name, | ||
hid_t | dst_loc_id, | ||
const char * | dst_name | ||
) |
Renames an object within an HDF5 file.
[in] | src_loc_id | Original file or group identifier |
[in] | src_name | Object's original name |
[in] | dst_loc_id | Destination file or group identifier |
[in] | dst_name | Object's new name |
H5Gmove2() renames an object within an HDF5 file. The original name, src_name
, is unlinked from the group graph and the new name, dst_name
, is inserted as an atomic operation.
src_name
and dst_name
are interpreted relative to src_loc_id
and dst_loc_id
, respectively, which are either file or group identifiers.
Opens an existing group for modification.
[in] | loc_id | Location identifier |
[in] | name | Name of the group to open |
H5Gopen1() opens an existing group with the specified name
at the specified location, loc_id
.
H5Gopen1() 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.
[in] | loc_id | Location identifier |
[in] | name | Name of the group to open |
H5Gopen1() opens an existing group with the specified name
at the specified location, loc_id
.
H5Gopen1() 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.
Opens an existing group in a file.
[in] | loc_id | Location identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute. |
[in] | name | Name of the group to open |
[in] | gapl_id | Group access property list identifier |
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 H5Gclose() when it is no longer needed to prevent resource leaks.
Refreshes all buffers associated with a group.
[in] | group_id | Group identifier |
H5Grefresh() causes all buffers associated with a group to be cleared and immediately re-loaded with updated contents from disk.
This function essentially closes the group, evicts all metadata associated with it from the cache, and then re-opens the group. The reopened group is automatically re-registered with the same identifier.
Sets comment for specified object.
[in] | loc_id | Location identifier. The identifier may be that of a file, group, dataset, or named datatype. |
[in] | name | Name of the object whose comment is to be set or reset |
[in] | comment | The new comment |
H5Gset_comment() sets the comment for the object specified by loc_id
and name
to comment
. Any previously existing comment will be overwritten.
loc_id
can specify any object in the file. name
can be one of the following:
If comment is the empty string or a null pointer, the comment message will be removed from the object. Comments should be relatively short, null-terminated, ASCII strings.
Comments can be attached to any object that has an object header, e.g., datasets, groups, and named datatypes, but not symbolic links.
Removes the link to an object from a group.
[in] | loc_id | Location identifier |
[in] | name | Name of the object to unlink |
H5Gunlink() removes the object specified by name
from the group graph and decrements the link count for the object to which name points. This action eliminates any association between name and the object to which name pointed.
Object headers keep track of how many hard links refer to an object; when the link count reaches zero, the object can be removed from the file. Objects which are open are not removed until all identifiers to the object are closed.
If the link count reaches zero, all file space associated with the object will be released, i.e., identified in memory as freespace. If any object identifier is open for the object, the space will not be released until after the object identifier is closed.
Note that space identified as freespace is available for re-use only as long as the file remains open; once a file has been closed, the HDF5 library loses track of freespace. See “Freespace Management” in the HDF5 User's Guide for further details.