Page tree

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

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »









Creates a soft link to an object. 


H5L_CREATE_SOFT(target_path, link_loc_id, link_name, lcpl_id, lapl_id)


herr_t H5Lcreate_soft( const char *target_path, hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id )

SUBROUTINE h5lcreate_soft_f(target_path, link_loc_id, link_name, hdferr, &
                            lcpl_id, lapl_id)
  CHARACTER(LEN=*), INTENT(IN) :: target_path
                                 ! Path to the target object, 
                                 ! which is not required to exist.
  INTEGER(HID_T), INTENT(IN) :: link_loc_id     
                                 ! The file or group identifier for the new link.
  CHARACTER(LEN=*), INTENT(IN) :: link_name       
                                 ! The name of the new link.
  INTEGER, INTENT(OUT) :: hdferr ! Error code: 
                                 ! 0 on success and -1 on failure
                                 ! Link creation property list identifier.
                                 ! Link access property list identifier.
END SUBROUTINE h5lcreate_soft_f

const char *target_path    IN: Path to the target object, which is not required to exist.
hid_t link_loc_idIN: The file or group identifier for the new link.
const char * link_nameIN: The name of the new link.
hid_t lcpl_idIN: Link creation property list identifier.
hid_t lapl_idIN: Link access property list identifier.


H5Lcreate_soft creates a new soft link to an object in an HDF5 file. The new link may be one of many that point to that object.

target_path specifies the path to the target object, i.e., the object that the new soft link points to. target_path can be anything and is interpreted at lookup time. This path may be absolute in the file or relative to link_loc_id.

link_loc_id must be a file or group identifier.

link_loc_id and link_name specify the location and name, respectively, of the new soft link. link_name is interpreted relative to link_loc_id and must contain only the name of the soft link; link_name may not contain any additional path elements.

If link_loc_id is a group identifier, the object pointed to by link_name will be accessed as a member of that group. If link_loc_id is a file identifier, the object will be accessed as a member of the file’s root group.

lcpl_id and lapl_id are the link creation and access property lists associated with the new link.

For instance, if target_path is ./foolink_loc_id specifies ./x/y/bar, and the name of the new link is new_link, then a subsequent request for ./x/y/bar/new_link will return same the object as would be found at ./foo.

H5Lcreate_soft is for use only if the target object is in the current file. If the desired target object is in a different file from the new link, use H5Lcreate_external to create an external link.

Soft links and external links are also known as symbolic links as they use a name to point to an object; hard links employ an object’s address in the file.

Unlike hard links, a soft link in an HDF5 file is allowed to dangle, meaning that the target object need not exist at the time that the link is created.

The HDF5 library does not keep a count of soft links as it does of hard links.


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


examples / h5_subset.c [32:42]  1.10/master  HDFFV/hdf5
main (void)
    hsize_t     dims[2], dimsm[2];   
    int         data[DIM0][DIM1];           /* data to write */
    int         sdata[DIM0_SUB][DIM1_SUB];  /* subset to write */
    int         rdata[DIM0][DIM1];          /* buffer for read */
    hid_t       file_id, dataset_id;        /* handles */
    hid_t       dataspace_id, memspace_id; 


     USE HDF5 ! This module contains all necessary modules


     CHARACTER(LEN=11), PARAMETER :: filename = "compound.h5" ! File name
     CHARACTER(LEN=8), PARAMETER :: dsetname = "Compound"     ! Dataset name
     INTEGER, PARAMETER :: dimsize = 6 ! Size of the dataset

     INTEGER(HID_T) :: file_id       ! File identifier

c++ / examples / create.cpp [33:43]  1.10/master  HDFFV/hdf5
int main (void)
    * Data initialization.
   int i, j;
   int data[NX][NY];          // buffer for data to write
   for (j = 0; j < NX; j++)
      for (i = 0; i < NY; i++)

public class H5Ex_D_Chunk {
    private static String FILENAME = "H5Ex_D_Chunk.h5";
    private static String DATASETNAME = "DS1";
    private static final int DIM_X = 6;
    private static final int DIM_Y = 8;
    private static final int CHUNK_X = 4;
    private static final int CHUNK_Y = 4;
    private static final int RANK = 2;
    private static final int NDIMS = 2;

Release    C
1.8.0Function introduced in this release.

--- Last Modified: November 14, 2017 | 09:17 AM