H5F_GET_NAME retrieves the name of the file to which the object
obj_id belongs. The object can be a file, group, dataset, attribute, or named datatype.
size characters of the file name 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 H5F_GET_NAME call can be made by setting
name to NULL. The return value of this call will be the size of the file name; that value plus one (1) can then be assigned to
size for a second H5F_GET_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.