H5Fget_name(hid_t obj_id,
char *name,
size_t size
)
H5Fget_name retrieves the name of the file
to which the object obj_id belongs.
The object can be a group, dataset, attribute, or
named datatype.
Up to size characters of the filename
are returned in name;
additional characters, if any, are not returned to
the user application.
If the length of the name,
which determines the required value of size,
is unknown, a preliminary H5Fget_name call
can be made by setting name to NULL.
The return value of this call will be the size of the filename;
that value plus one (1) can then be assigned to size
for a second H5Fget_name call,
which will retrieve the actual name.
(The value passed in with the parameter size must be
one greater than size in bytes of the actual name in order to
accommodate the null terminator; if size is set to
the exact size of the name, the last byte passed back will
contain the null terminator and the last character will be
missing from the name passed back to the calling application.)
If an error occurs, the buffer pointed to by
name is unchanged and
the function returns a negative value.
obj_id
name
size
name buffer.
SUBROUTINE h5fget_name_f(obj_id, buf, size, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier
CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Buffer to hold filename
INTEGER(SIZE_T), INTENT(OUT) :: size ! Size of the filename
INTEGER, INTENT(OUT) :: hdferr ! Error code: 0 on success,
! -1 if fail
END SUBROUTINE h5fget_name_f
| Release | C |
| 1.6.3 |
Function introduced in this release. Fortran subroutine introduced in this release. |