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 »

 

JAVA

FORTRAN

C++

C

 

Link

H5L_COPY

Copies a link from one location to another.

Procedure:

H5L_COPY(src_loc_id, src_name, dest_loc_id, dest_name, lcpl_id, lapl_id)

Signature:

herr_t H5Lcopy( hid_t src_loc_id, const char *src_name, hid_t dest_loc_id, const char *dest_name, hid_t lcpl_id, hid_t lapl_id )

SUBROUTINE h5lcopy_f(src_loc_id, src_name, dest_loc_id, dest_name, hdferr, &
                     lcpl_id, lapl_id)
  IMPLICIT NONE
  INTEGER(HID_T), INTENT(IN) :: src_loc_id 
                                   ! Location identifier of the source link
  CHARACTER(LEN=*), INTENT(IN) :: src_name   
                                   ! Name of the link to be copied
  INTEGER(HID_T), INTENT(IN) :: dest_loc_id 
                                   ! Location identifier specifying the 
                                   ! destination of the copy
  CHARACTER(LEN=*), INTENT(IN) :: dest_name 
                                   ! Name to be assigned to the new copy
  INTEGER, INTENT(OUT) :: hdferr   ! Error code: 
                                   ! 0 on success and -1 on failure
  INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id 
                                   ! Link creation property list identifier
  INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id 
                                   ! Link access property list identifier
END SUBROUTINE h5lcopy_f

Parameters:
hid_t src_loc_idIN: Location identifier of the source link
const char *src_nameIN: Name of the link to be copied
hid_t dest_loc_idIN: Location identifier specifying the destination of the copy
const char *dest_name    IN: Name to be assigned to the new copy
hid_t lcpl_idIN: Link creation property list identifier
hid_t lapl_idIN: Link access property list identifier

Description:

H5Lcopy copies the link specified by src_name from the file or group specified by src_loc_id to the file or group specified by dest_loc_id. The new copy of the link is created with the name dest_name.

If dest_loc_id is a file identifier, dest_name will be interpreted relative to that file’s root group.

The new link is created with the creation and access property lists specified by lcpl_id and lapl_id. The interpretation of lcpl_id is limited in the manner described in the next paragraph.

H5Lcopy retains the creation time and the target of the original link. However, since the link may be renamed, the character encoding is that specified in lcpl_id rather than that of the original link. Other link creation properties are ignored.

If the link is a soft link, also known as a symbolic link, its target is interpreted relative to the location of the copy.

Several properties are available to govern the behavior of H5Lcopy. These properties are set in the link creation and access property lists, lcpl_id and lapl_id, respectively. The property controlling creation of missing intermediate groups is set in the link creation property list with H5Pset_create_intermediate_group; this function ignores any other properties in the link creation property list. Properties controlling character encoding, link traversals, and external link prefixes are set in the link access property list withH5Pset_char_encodingH5Pset_nlinks, and H5Pset_elink_prefix.

H5Lcopy does not affect the object that the link points to.

H5Lcopy cannot copy hard links across files as a hard link is not valid without a target object; to copy objects from one file to another, see H5Ocopy.

Returns:

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

Example:

examples / h5_subset.c [32:42]  1.10/master  HDFFV/hdf5
int
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; 

     PROGRAM COMPOUNDEXAMPLE

     USE HDF5 ! This module contains all necessary modules

     IMPLICIT NONE

     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;

History:
Release    C
1.8.0Function introduced in this release.

--- Last Modified: November 14, 2017 | 08:45 AM