This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Create hard link to specified object


Description,new_loc_id,new_link_name,lcpl_id,lapl_id) creates a hard link to an object, where new_loc_id and new_link_name specify the location. lcpl_id and lapl_id are the link creation and access property lists associated with the new link. is designed to add additional structure to an existing file so that, for example, an object can be shared among multiple groups.


Create a hard link from group '/g2' to the dataset '/g1/ds1'.

plist_id = 'H5P_DEFAULT';
fid = H5F.create('myfile.h5','H5F_ACC_TRUNC',plist_id,plist_id);
gid1 = H5G.create(fid,'/g1',plist_id);
space_id = H5S.create_simple(1,10,[]);
ds1 = H5D.create(gid1,'ds1','H5T_NATIVE_INT',space_id,plist_id);
gid2 = H5G.create(fid,'/g2',plist_id);,gid2,'ds2',plist_id,plist_id);
H5G.close(gid2); H5G.close(gid1);