Many HDF5 function calls use a combination of a location and name to identify an HDF5 object.
The location will be specified by a location identifier, loc_id
, and will be an HDF5 file or object such as a group, dataset, or committed datatype*.
The name parameter, name
, will be a character string and will specify the links to an object in an HDF5 file. The link or links to the object will be either an absolute path or a relative path. An absolute path will include all of the links from the root group to the object. A relative path will include all of the links from any other group to the object.
Several loc_id
and name
combinations are possible. To illustrate, the following combinations all identify dset3
in the file structure in the figure.
- If
loc_id
is a file identifier, name
must specify the object from the file’s root group.loc_id
specifies the file DATA_FILE1
.
name = '/group2/group3/dset3'
- If
loc_id
is a group identifier and the object of interest is a member of that group, name
will simply be the name of the link to the object.loc_id
specifies group3
.
name = 'dset3'
- If
loc_id
is a group identifier but the object of interest is not a direct member of that group, name
would specify the object by a path relative to that group.loc_id
specifies group2
.
name = 'group3/dset3'
Alternatively, name
could specify the object with an absolute path in the file containing loc_id
.
loc_id
specifies group2
.
name = '/group2/group3/dset3'
- There is one special case: if
loc_id
is the identifier of the object itself, name
should be a dot ( .
). For those familiar with a UNIX shell, this works in much the same manner as a dot ( .
) specifying the current working directory.loc_id
specifies dset3
, the dataset itself.
name = '.'
Many HDF5 functions accept loc_id
and name
in all of the above combinations. When accepted combinations are limited for a specific function, the limitations are mentioned in the function’s reference manual entry.
For a related discussion of the structure of HDF5 files and HDF5 path names, see “The Structure of an HDF5 File” (particularly the sub-section “HDF5 Path Names and Navigation”) in the “HDF5 Data Model and File Structure” chapter of the HDF5 User’s Guide.
* In the past, a committed datatype was known as a named datatype.