The h5clear
tool can either clear the
status_flags
field in the superblock of the file or close
a metadata cache image in the specified file.
With the implementation of file locking, the library uses the
status_flags
field in the superblock to mark a
file as in writing or SWMR writing mode when a file is opened.
The library will clear this field when the file closes.
However, a situation may occur where an open file is closed
without going through the normal library file closing procedure,
and this field will not be cleared as a result. An example would
be if an application program crashed. This situation will prevent
a user from opening the file. The h5clear
tool will
clear the status_flags
field, and the user can
then open the file.
When used to close a metadata cache image, h5clear
will
open the supplied HDF5 file in Read-Write (R/W) mode, check to see
if it contains a cache image, and then close it. If the file does
not contain a cache image, h5clear
will generate a warning message
to that effect.