Name: H5Fget_name
Signature:
ssize_t H5Fget_name(hid_t obj_id, char *name, size_t size )
Purpose:
Retrieves name of file to which object belongs.
Description:
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.

Parameters:
hid_t obj_id
IN: Identifier of the object for which the associated filename is sought. The object can be a group, dataset, attribute, or named datatype.
char *name
OUT: Buffer to contain the returned filename.
size_t size
IN: Size, in bytes, of the name buffer.
Returns:
Returns the length of the filename if successful; otherwise returns a negative value.
Fortran90 Interface: h5fget_name_f
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
    
History: