HDF5  1.13.0
H5Fcreate.c

After creating an HDF5 file with H5Fcreate(), we close it with H5Fclose().

#include "hdf5.h"
int main()
{
hid_t file;
if ((file = H5Fcreate("foo.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
return -1;
/* Do something good with this file. */
if(H5Fclose(file) < 0)
return -2;
return 0;
}
H5P_DEFAULT
#define H5P_DEFAULT
Definition: H5Ppublic.h:104
hid_t
int64_t hid_t
Definition: H5Ipublic.h:59
H5Fclose
herr_t H5Fclose(hid_t file_id)
Terminates access to an HDF5 file.
H5F_ACC_TRUNC
#define H5F_ACC_TRUNC
Definition: H5Fpublic.h:52
H5Fcreate
hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
Creates an HDF5 file.