H5Fget_file_image
(
hid_t file_id
,
void *buf_ptr
,
size_t *buf_len
)
H5Fget_file_image
and other elements of HDF5 are
used to load an image of an HDF5 file into system memory and open
that image as a regular HDF5 file.
An application can then use the file without the overhead of disk I/O.
See the “See Also” section below for links to other elements of HDF5 file image operations.
H5Fget_file_image
retrieves a copy of the image of an existing, open file.
This routine can be used with files opened using the
SEC2 (or POSIX),
STDIO, and
Core (or Memory) virtual file drivers (VFDs).
If the return value of H5Fget_file_image
is a positive value, it will be the length in bytes of the buffer
required to store the file image.
So if the file size is unkown, it can be safely determined
with an initial H5Fget_file_image
call with
buf_ptr
set to NULL
.
The file image can then be retrieved with a second
H5Fget_file_image
with buf_len
set to the initial call’s return value.
While the current file size can also be retrieved with
H5Fget_filesize
, that call may produce a larger
value than is needed.
The value returned by H5Fget_filesize
includes
the user block, if it exists, and any unallocated space
at the end of the file.
It is safe in all situations to get the file size with
H5Fget_file_image
and it often produces a value
that is more appropriate for the size of a file image buffer.
hid_t file_id
| IN: Target file identifier | |
void *buf_ptr
| IN: Pointer to the buffer into which the image of the HDF5 file
is to be copied
If | |
size_t *buf_len
| IN: Size of the supplied buffer |
H5Pget_file_image
will fail, returning a negative value,
if the file is too large for the supplied buffer.
H5LTopen_file_image
H5Pset_file_image
H5Pget_file_image
H5Pset_file_image_callbacks
H5Pget_file_image_callbacks
| |
“HDF5
File Image Operations”
in Advanced Topics in HDF5
Within H5Pset_file_image_callbacks :
Callback struct H5_file_image_callbacks_t
Callback ENUM H5_file_image_op_t
|
Release | Change |
1.8.9 | C function introduced in this release. |