H5Fget_name: Retrieve the name of the file to which an object belongs

View source: R/H5F.R

H5Fget_nameR Documentation

Retrieve the name of the file to which an object belongs

Description

Retrieve the name of the file to which an object belongs

Usage

H5Fget_name(h5obj)

Arguments

h5obj

An object of class H5IdComponent. Despite this being an H5F function, it works equally well on H5 file, group, dataset and attribute datatypes.

Examples


## use an example file and show its location
h5file <- system.file("testfiles", "h5ex_t_array.h5", package = "rhdf5")
h5file

## open a file handle and confirm we can identify the file it points to
fid <- H5Fopen(h5file)
H5Fget_name(fid)

## H5Fget_name() can be applied to group and dataset handles too
gid <- H5Gopen(fid, name = "/")
did <- H5Dopen(fid, name = "DS1")
H5Fget_name(gid)
H5Fget_name(did)

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


grimbough/rhdf5 documentation built on Dec. 9, 2024, 8:40 p.m.