Page tree









Returns information about a link

As of HDF5-1.12 this function has been deprecated in favor of the function H5L_GET_INFO2 or the macro H5L_GET_INFO.


H5L_GET_INFO1 ( loc_id, name, linfo, lapl_id )


herr_t H5Lget_info1 ( hid_t loc_id, const char *name, H5L_info1_t *linfo /*out*/, hid_t lapl_id)

SUBROUTINE h5lget_info_f(link_loc_id, link_name, &
     cset, corder, f_corder_valid, link_type, address, val_size, &
     hdferr, lapl_id)
  INTEGER(HID_T), INTENT(IN) :: link_loc_id 
                        ! File or group identifier.
  CHARACTER(LEN=*), INTENT(IN) :: link_name 
                        ! Name of the link for which information is being sought.
                        ! Indicates the character set used for the link’s name. 
  INTEGER, INTENT(OUT) :: corder 
                        ! Specifies the link’s creation order position.
  LOGICAL, INTENT(OUT) :: f_corder_valid 
                        ! Indicates whether the value in corder is valid.
  INTEGER, INTENT(OUT) :: link_type 
                        ! Specifies the link class:
                        !  H5L_TYPE_HARD_F      - Hard link
                        !  H5L_TYPE_SOFT_F      - Soft link
                        !  H5L_TYPE_EXTERNAL_F  - External link
                        !  H5L_TYPE_ERROR_F     - Error
  INTEGER(HADDR_T), INTENT(OUT) :: address  
                        ! If the link is a hard link, address specifies the file
                        ! address that the link points to
  INTEGER(SIZE_T), INTENT(OUT) :: val_size 
                        ! If the link is a symbolic link, val_size will be the 
                        ! length of the link value, i.e. the length of the name 
                        ! of the pointed-to object with a null terminator. 

  INTEGER, INTENT(OUT) :: hdferr 
                        ! Error code:
                        ! 0 on success and -1 on failure
                        ! Link access property list
END SUBROUTINE h5lget_info_f

hid_t loc_idIN: Location identifier; may be a file, group, dataset, named datatype or attribute identifier
const char *nameIN: Name of the link for which information is being sought
H5L_info1_t *linfo   
OUT: Buffer in which link information is returned
hid_t lapl_idIN: Link access property list identifier


H5L_GET_INFO1 returns information about the specified link through the linfo argument.

The location identifier, loc_id, specifies the location of the link. A link name, name, interpreted relative to loc_id, specifies the link being queried.

lapl_id is the link access property list associated with the link name. In the general case, when default link access properties are acceptable, this can be passed in as H5P_DEFAULT. An example of a situation that requires a non-default link access property list is when the link is an external link; an external link may require that a link prefix be set in a link access property list (see H5P_SET_ELINK_PREFIX).

H5L_GET_INFO returns information about name in the data structure H5L_info1_t, which is described below and defined in H5Lpublic.h. This structure is returned in the buffer linfo.

    typedef struct {
        H5L_type_t     type;
        hbool_t        corder_valid;
        int64_t        corder;
        H5T_cset_t     cset;
        union {
            haddr_t    address;
            size_t     val_size;
        } u;
    } H5L_info1_t;

In the above struct, type specifies the link class. Valid values include the following:

H5L_TYPE_HARDHard link
H5L_TYPE_SOFTSoft link
H5L_TYPE_EXTERNAL    External link

There will be additional valid values if user-defined links have been registered.

corder specifies the link’s creation order position while corder_valid indicates whether the value in corder is valid.

If corder_valid is TRUE, the value in corder is known to be valid; if corder_valid is FALSE, the value in corder is presumed to be invalid;

corder starts at zero (0) and is incremented by one (1) as new links are created. But higher-numbered entries are not adjusted when a lower-numbered link is deleted; the deleted link’s creation order position is simply left vacant. In such situations, the value of corder for the last link created will be larger than the number of links remaining in the group.

cset specifies the character set in which the link name is encoded. Valid values include the following:

H5T_CSET_UTF8    UTF-8 Unicode encoding

This value is set with H5P_SET_CHAR_ENCODING.

address and val_size are returned for hard and symbolic links, respectively. Symbolic links include soft and external links and some user-defined links.

If the link is a hard link, address specifies the file address that the link points to.

If the link is a symbolic link, val_size will be the length of the link value, e.g., the length of the name of the pointed-to object with a null terminator.


Returns a non-negative value if successful, with the fields of linfo (if non-null) initialized. Otherwise returns a negative value.


Release    Change
1.12.0Function was deprecated.
1.8.0Function introduced in this release.
1.8.2Fortran subroutine added in this release.
1.8.4Fortran subroutine syntax changed in this release.

--- Last Modified: February 13, 2020 | 03:41 PM