H5L_info2_t me meaning of member variables



From the given hdf5 manual page I can see the description of H5L_info2_t as:

typedef struct {    
    H5L_type_t          type;           /* Type of link                   */
    hbool_t             corder_valid;   /* Indicate if creation order is valid */
    int64_t             corder;         /* Creation order                 */
    H5T_cset_t          cset;           /* Character set of link name     */
    union {
        H5O_token_t     token;          /* Token of location that hard link points to */
        size_t          val_size;       /* Size of a soft link or UD link value */    
} H5L_info2_t;

I can’t understand some of them:

  1. In which situations we may need creation order?
  2. If I need to check whether two ID refers to the same object can I compare token instead of deprecated address? And if so does this take into account whether these two objects resides in the same h5-file or not (if for example there are two files and each of them contains the group with common name)?
  3. What is val_size of soft Link (and UD)? is it path length to the referred object?

  1. Sometimes people want to track the link creation order so that they can iterate over them by creation order. (see https://portal.hdfgroup.org/display/HDF5/H5P_SET_LINK_CREATION_ORDER)
  2. Yes, see H5Otoken_cmp (https://portal.hdfgroup.org/display/HDF5/H5O_TOKEN_CMP). The requirement is that the tokens come from the same VOL connector class. (Yes, that’s the case for native HDF5 files.)
  3. Almost. It’s the length of the buffer that represents the encoded link value/target. For external links, that would be the link_size parameter in H5Lunpack_elink_val (https://portal.hdfgroup.org/display/HDF5/H5L_UNPACK_ELINK_VAL). For all links, that’s size in h5Lget_val (https://portal.hdfgroup.org/display/HDF5/H5L_GET_VAL), and, yes, for symbolic links that’s more or less the path name length in bytes. (If the path contains non-single byte UTF-8 characters, this is not equal to the length in code points.)



Thank you very much!