H5Olink: Create a hard link to an object in an HDF5 file

View source: R/H5O.R

H5OlinkR Documentation

Description

Create a hard link to an object in an HDF5 file

Usage

H5Olink(h5obj, h5loc, newLinkName, lcpl = NULL, lapl = NULL)

Arguments

h5obj

An object of class H5IdComponent representing the object to be linked to.

h5loc

An object of class H5IdComponent representing the location at which the object is to be linked. Can represent a file, group, dataset, datatype or attribute.

newLinkName

Character string giving the name of the new link. This should be relative to h5loc.

lcpl, lapl

H5IdComponent objects representing link creation and link access property lists respectively. If left as NULL the default values for these will be used.

See Also

H5Gcreate_anon

Examples

## Create a temporary copy of an example file, and open it
example_file <- system.file("testfiles", "h5ex_t_array.h5", package="rhdf5")
file.copy(example_file, tempdir())
h5_file <- file.path(tempdir(), "h5ex_t_array.h5")
fid <- H5Fopen( h5_file )

## create a new group without a location in the file
gid <- H5Gcreate_anon(fid)

## create link to newly create group
## relative to the file identifier
H5Olink(h5obj = gid, h5loc = fid, newLinkName = "foo")

## tidy up
H5Gclose(gid)
H5Fclose(fid)

## Check we now have a "/foo" group
h5ls( h5_file )


grimbough/rhdf5 documentation built on April 16, 2024, 8:22 p.m.