H5F: File Interface

File API Functions

These functions are designed to provide file-level access to HDF5 files. Further manipulation of objects inside a file is performed through one of APIs documented below.
             

Name: H5Fopen
Signature:
hid_t H5Fopen(const char *name, uintn flags, hid_t access_template )
Description:
This is the primary function for opening existing HDF5 files. The flags parameter determines the file access mode. There is no read flag, all open files are implicitily opened for read access. All flags may be combined with the '|' (boolean OR operator) to change the behavior of the file open call. The access_template parameter is a template containing additional information required for specific methods of access, parallel I/O for example. The paramters for access templates are described in the H5P API documentation.
Parameters:
const char *name
Name of the file to access.
uintn flags
File access flags:
    H5F_ACC_RDWR
    Allow read and write access to file.
hid_taccess_template
Template indicating the file access properties. If parallel file access is desired, this is a collective call according to the communicator stored in the access_template. Use 0 for default access template.
Returns:
A file identifier if successful; otherwise FAIL (-1).

Name: H5Fcreate
Signature:
hid_t H5Fcreate(const char *name, uintn flags, hid_t create_template, hid_t access_template )
Description:
This is the primary function for opening and creating HDF5 files. The flags parameter determines whether an existing file will be overwritten or not. All newly created files are opened for both reading and writing. All flags may be combined with the '|' (boolean OR operator) to change the behavior of the file open call. The create_template and access_template parameters are templates containing additional information required for specific methods of access or particular aspects of the file to set when creating a file. The parameters for creation and access templates are described in the H5P API documentation.
Parameters:
const char *name
Name of the file to access.
uintn flags
File access flags:
    H5F_ACC_TRUNC
    Truncate file, if it already exists. The file will be truncated, erasing all data previously stored in the file.
hid_tcreate_template
File creation template ID, used when modifying default file meta-data
hid_taccess_template
Template indicating the file access properties. If parallel file access is desired, this is a collective call according to the communicator stored in the access_template. Use 0 for default access template.
Returns:
An ID (of type hid_t) for the file upon success, otherwise negative

Name: H5Fis_hdf5
Signature:
hbool_t H5Fis_hdf5(const char *name )
Description:
This function determines whether a file is in the HDF5 format.
Parameters:
const char *name
File name to check format.
Returns:
TRUE/FALSE/negative

Name: H5Fget_create_template
Signature:
hid_t H5Fget_create_template(hid_t file_id )
Description:
This function returns an template ID with a copy of the parameters used to create this file. Useful for duplicating the parameters when creating another file.
Parameters:
hid_t file_id
File ID to get creation template of
Returns:
zero/negative

Name: H5Fclose
Signature:
herr_t H5Fclose(hid_t file_id )
Description:
This function terminates access to an HDF5 file. If this is the last file ID open for a file and if access IDs are still in use, this function will fail.
Parameters:
hid_t file_id
File ID to terminate access to.
Returns:
zero/negative


Frank Baker
HDF5 Documentation
Last modified: 29 June 1998