% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/S3_utils.R
\name{list_datasets}
\alias{list_datasets}
\title{List datasets in an HDF5 file or group}
\usage{
list_datasets(x, group = NULL, prefix = NULL, recursive = FALSE)
}
\arguments{
\item{x}{An \code{HDF5Matrix} object, or a character string
(file path).}

\item{group}{Character or \code{NULL}. Group path inside the HDF5
file. If \code{NULL} and \code{x} is a file path, the whole file is
listed recursively. If \code{NULL} and \code{x} is an
\code{HDF5Matrix}, the object's own group is used (non-recursive).}

\item{prefix}{Optional character. Only return datasets whose name
starts with this prefix.}

\item{recursive}{Logical. If \code{TRUE}, recurse into subgroups and
return full relative paths. Default \code{FALSE}.}
}
\value{
Character vector of dataset names or relative paths.
}
\description{
Lists datasets within an HDF5 file. If no group is specified, the entire
file is traversed recursively and full relative paths are returned
(e.g. \code{"INPUT/A"}, \code{"RESULTS/SVD/d"}). If a group is given,
only the datasets in that group are listed unless \code{recursive = TRUE}.
}
\examples{
\donttest{
fn <- tempfile(fileext = ".h5")
hdf5_create_matrix(fn, "INPUT/A",    data = matrix(rnorm(100), 10, 10))
hdf5_create_matrix(fn, "INPUT/B",    data = matrix(rnorm(100), 10, 10))
hdf5_create_matrix(fn, "RESULTS/C",  data = matrix(rnorm(100), 10, 10))

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

# Only INPUT group
list_datasets(fn, group = "INPUT")

# From an HDF5Matrix object (uses object's own group)
X <- hdf5_matrix(fn, "INPUT/A")
list_datasets(X)

hdf5_close_all()
unlink(fn)
}

}
\seealso{
\code{\link{hdf5_matrix}}, \code{\link{hdf5_create_matrix}}
}
