hdf5_close_file: Close all HDF5 handles for a specific file

View source: R/hdf5CloseAll.R

hdf5_close_fileR Documentation

Close all HDF5 handles for a specific file

Description

Closes all open HDF5Matrix objects and HDF5 C library handles associated with a single HDF5 file, without affecting other open files.

Usage

hdf5_close_file(x)

Arguments

x

An HDF5Matrix object, or a character string with the path to the HDF5 file.

Value

Invisibly, the absolute path of the closed file.

See Also

hdf5_close_all to close all files at once.

Examples


fn1 <- tempfile(fileext = ".h5")
fn2 <- tempfile(fileext = ".h5")
A <- hdf5_create_matrix(fn1, "data/A", data = matrix(1:9, 3, 3))
B <- hdf5_create_matrix(fn2, "data/B", data = matrix(1:9, 3, 3))

# Close only fn1 — B remains open and usable
hdf5_close_file(fn1)
dim(B)   # still works

hdf5_close_all()
unlink(c(fn1, fn2))



BigDataStatMeth documentation built on May 15, 2026, 1:07 a.m.