bdgetDatasetsList_hdf5

bdgetDatasetsList_hdf5

HDF5_IO_MANAGEMENT

1 Description

Retrieves a list of all datasets within a specified HDF5 group, with optional filtering by prefix or suffix.

2 Usage

bdgetDatasetsList_hdf5(filename, group = NULL, prefix = NULL, recursive = FALSE)

3 Arguments

Parameter Description
filename Character string. Path to the HDF5 file.
group Character string or . Group path within the HDF5 file. If (default), the entire file is traversed recursively and dataset paths are returned relative to the root (e.g. , ).
prefix Optional character string. Only return datasets whose name starts with this prefix.
recursive Logical. If , recurse into subgroups and return full relative paths. Ignored when (always recursive). Default .

4 Value

Character vector containing dataset names.

5 Details

This function provides flexible dataset listing capabilities for HDF5 files. Key features: - Listing options: - All datasets in a group - Datasets matching a prefix - Datasets matching a suffix - Implementation features: - Safe HDF5 file operations - Memory-efficient implementation - Comprehensive error handling - Read-only access to files

The function opens the HDF5 file in read-only mode to ensure data safety.

6 Examples

\donttest{
fn <- tempfile(fileext = ".h5")
X  <- hdf5_create_matrix(fn, "INPUT/A",  data = matrix(rnorm(100), 10, 10))
Y  <- hdf5_create_matrix(fn, "INPUT/B",  data = matrix(rnorm(100), 10, 10))
Z  <- hdf5_create_matrix(fn, "RESULTS/C",data = matrix(rnorm(100), 10, 10))

# All datasets in the file (recursive from root)
bdgetDatasetsList_hdf5(fn)

# Only datasets in INPUT group
bdgetDatasetsList_hdf5(fn, group = "INPUT")

# INPUT group, recursive (same result here, no subgroups)
bdgetDatasetsList_hdf5(fn, group = "INPUT", recursive = TRUE)

# Filter by prefix
bdgetDatasetsList_hdf5(fn, group = "INPUT", prefix = "A")

hdf5_close_all()
unlink(fn)
}