hdf5_close_file

hdf5_close_file

HDF5MATRIX_CORE

1 Description

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

2 Usage

hdf5_close_file(x)

3 Arguments

Parameter Description
x An object, or a character string with the path to the HDF5 file.

4 Value

Invisibly, the absolute path of the closed file.

5 Examples

\donttest{
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))
}

6 See Also

hdf5_close_all to close all files at once.