Main Content


Value of symbolic link


linkval = H5L.get_val(link_loc_id,link_name,lapl_id)
linkval = H5L.get_val(link_loc_id,link_name,lapl_id,'TextEncoding',encoding)


linkval = H5L.get_val(link_loc_id,link_name,lapl_id) returns the value of a symbolic link.

link_loc_id is a file or group identifier. link_name identifies a symbolic link and is defined relative to link_loc_id. Symbolic links include soft and external links and some user-defined links.

In the case of soft links, linkval is a cell array containing the path to which the link points.

In the case of external links, linkval is a cell array consisting of the name of the target file and the object name.

This function corresponds to the H5L.get_val and H5Lunpack_elink_val functions in the HDF5 1.8 C API.

linkval = H5L.get_val(link_loc_id,link_name,lapl_id,'TextEncoding',encoding) additionally specifies the text encoding to use to interpret the link value. Specify encoding as 'system'(default) or 'UTF-8'.

  • 'system' — Use the system default encoding to interpret the link value.

  • 'UTF-8' — Use UTF-8 encoding to interpret the link value.


fid ='example.h5');
gid =,'/g1/g1.2/g1.2.1');
linkval = H5L.get_val(gid,'slink','H5P_DEFAULT');