h5closeAll: Close open HDF5 handles

View source: R/H5.R

h5closeAllR Documentation

Close open HDF5 handles

Description

This functions can be used in two ways. Firstly, it can be passed one or more H5IdComponent objects and it'll will try to close all of them regardless of the whether they represent a file, group, dataset etc. This can be easier than making multiple calls to H5Fclose(), H5Gclose(), etc.

Usage

h5closeAll(...)

Arguments

...

One or more objects of class H5IdComponent which should be closed. If nothing is provided to the function, all open handles will be closed.

Details

Secondly, cccasionally references to HDF5 files, groups, datasets etc can be created and not closed correctly. Maybe because a function stopped before getting to the close statement, or the open handle was not assigned to an R variable. If no arguments are provide this function identifies all open handles and closes them.

Value

Doesn't return anything. Called for the side-effect of closing open HDF5 handles.

Author(s)

Mike Smith

Examples



## create an empty file and then re-open it
h5File <- tempfile(pattern = "ex_h5closeAll.h5")
h5createFile(h5File)
H5Fopen(h5File)

## list all open identifiers
h5listIdentifier()

## close all open identifiers and verify
h5closeAll()
h5listIdentifier()


grimbough/rhdf5 documentation built on April 16, 2024, 8:22 p.m.