Page tree

The license could not be verified: License Certificate has expired!

 

JAVA

FORTRAN

C++

C

 

Link

H5F_GET_FILENO

Retrieves a file's file number that uniquely identifies an open file

Procedure:

H5F_GET_FILENO ( file_id, fnumber )

Signature:

herr_t H5Fget_fileno (hid_t file_id, unsigned long *fnumber )

  SUBROUTINE h5fget_fileno_f(file_id, fileno, hdferr)
    IMPLICIT NONE
    INTEGER(HID_T), INTENT(IN) :: file_id  ! file identifier
    INTEGER, INTENT(OUT) :: fileno         ! File number
    INTEGER, INTENT(OUT) :: hdferr         ! Error code: 0 on success,
                                           !     -1 if fail
 END SUBROUTINE h5fget_fileno_f

Parameters
hid_t file_idIN: The file identifier
unsigned long *fnumberIN: A pointer to the file

Description:

H5F_GET_FILENO retrieves a file number for a file specified by the file identifier file_id and the pointer fnumber to the file.

Returns:

Returns a non-negative value if successful; otherwise returns a negative value.

Example:

test / tfile.c [2120:2130]  hdf5_1_12  HDFFV/hdf5
    /* Create dataset with second file ID */
    did2 = H5Dcreate2(fid2, DSET2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
    CHECK(did2, FAIL, "H5Dcreate2");

    /* Check number of objects opened in first file */
    nobjs = H5Fget_obj_count(fid2, H5F_OBJ_ALL);
    VERIFY(nobjs, 2, "H5Fget_obj_count"); /* 3 == file & dataset */

    /* Close dataspace */
    ret = H5Sclose(sid);
    CHECK(ret, FAIL, "H5Sclose");

fortran / test / tH5F.F90 [295:304]  hdf5_1_12  HDFFV/hdf5
          !
          !Check file numbers
          !
          CALL h5fget_fileno_f(file1_id, file_num1, error)
               CALL check("h5fget_fileno_f",error,total_error)
          CALL h5fget_fileno_f(file2_id, file_num2, error)
               CALL check("h5fget_fileno_f",error,total_error)
          IF(file_num1 .EQ. file_num2) THEN
               write(*,*) "file numbers aren't supposed to match"
          END IF

History:
ReleaseChange
1.12.0Function introduced.

--- Last Modified: June 02, 2020 | 09:39 AM