Please, help us to better serve our user community by answering the following short survey: https://www.hdfgroup.org/website-survey/
HDF5  1.15.0.a6e610e
API Reference
Programming Issues

Navigate back: Main / Getting Started with HDF5 / Learning the Basics


Keep the following in mind when looking at the example programs included in this tutorial:

APIs vary with different languages

  • C routines begin with the prefix “H5*” where * is a single letter indicating the object on which the operation is to be performed:
    File Interface: H5Fopen
    Dataset Interface: H5Dopen
  • FORTRAN routines begin with “h5*” and end with “_f”:
    File Interface: h5fopen_f
    Dataset Interface: h5dopen_f
  • Java routine names begin with “H5*” and are prefixed with “H5.” as the class. Constants are in the HDF5Constants class and are prefixed with "HDF5Constants.".:
    File Interface: H5.H5Fopen
    Dataset Interface: H5.H5Dopen
  • APIS for languages like C++, Java, and Python use methods associated with specific objects.

HDF5 library has its own defined types

  • hid_t is used for object handles
  • hsize_t is used for dimensions
  • herr_t is used for many return values

Language specific files must be included in applications

  • Python: Add "import h5py / import numpy"
  • C: Add "#include hdf5.h"
  • FORTRAN: Add "USE HDF5" and call h5open_f and h5close_f to initialize and close the HDF5 FORTRAN interface
  • Java: Add "import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants;"

Navigate back: Main / Getting Started with HDF5 / Learning the Basics