# \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))
# }
Run the code above in your browser using DataLab