fields.buffers.core.HDF5Buffer.close#
- HDF5Buffer.close(force: bool = False)[source]#
Close the underlying HDF5 file, if owned by this buffer.
This method closes the file used by this buffer if: - It was opened by the buffer (i.e., the buffer owns it), or - force=True is explicitly specified.
After calling this method, the buffer becomes invalid for further access or modification. Attempting to access data will raise errors.
- Parameters:
force (
bool
, defaultFalse
) – If True, closes the file regardless of ownership. Use with care to avoid interfering with shared file handles.- Raises:
AttributeError – If the file handle is already invalid or closed.
See also
flush
For non-destructive persistence.