# HDF5/Tools API Specification

Introduction to HDF5 HDF5 User Guide Other HDF5 documents and links | And in this document, the HDF5 Reference Manual H5 H5A H5D H5E H5F H5G H5I H5P H5R H5RA H5S H5T H5Z Tools

# HDF5 Tools

## HDF5 Tool Interfaces

These tools enable the user to examine HDF5 files interactively.

- h5dump -- A tool for displaying HDF5 file contents
- h5ls -- A tool for listing specified features of HDF5 file contents
- h5repart -- A tool for repartitioning a file, creating a family of files
- h5toh4 -- A tool for converting an HDF5 file to an HDF4 file.

Tool Name: h5dump
Syntax:
  `h5dump [-h] [-bb] [-header] [-a` names`] [-d` names`] [-g` names`] [-l` names`] [-t` names`]` file
Purpose:
  Displays HDF5 file contents.
Description:
  `h5dump` enables the user to interactively examine the contents of an HDF5 file and dump those contents, in human readable form, to an ASCII file.

  `h5dump` displays HDF5 file content on standard output. It may display the content of the whole HDF5 file or selected objects, which can be groups, datasets, links, attributes, or data types.

  The `-header` option displays object header information only.

  Names are the absolute names of the objects. `h5dump` displays objects in the order same as the command order. If a name does not start with a slash, `h5dump` begins searching for the specified object starting at the root group.

  If an object is hard linked with multiple names, `h5dump` displays the content of the object in the first occurrence. Only the link information is displayed in later occurrences.

  `h5dump` assigns a name for any unnamed data type in the form of `#`oid1`:`oid2, where oid1 and oid2 are the object identifiers assigned by the library. The unnamed types are displayed within the root group.

  Data types are displayed with standard type names. For example, if a data set is created with `H5T_NATIVE_INT` type and the standard type name for integer on that machine is `H5T_STD_I32BE`, `h5dump` displays `H5T_STD_I32BE` as the type of the data set.

  The `h5dump` output is described in detail in the DDL for HDF5, the Data Description Language document.

Options and Parameters:

`-h`
  Prints information on this command.
`-bb`
  Displays the contents of the boot block. The default is not to display.
`-header`
  Displays header information only; no data is displayed.
`-a` names
  Displays the specified attribute(s).
`-d` names
  Displays the specified dataset(s).
`-g` names
  Displays the specified group(s) and all the members.
`-l` names
  Displays the values of the specified soft link(s).
`-t` names
  Displays the specified named data type(s).
file
  The file to be examined.

Current Status:
  The current version of `h5dump` displays the following information:
  - Group
    - group attribute (see Attribute)
    - group member
  - Dataset
    - dataset attribute (see Attribute)
    - dataset type (see Data type)
    - dataset space (see Data space)
    - dataset data
  - Attribute
    - attribute type (see Data type)
    - attribute space (see Data space)
    - attribute data
  - Data type
    - integer type
- H5T_STD_I8BE, H5T_STD_I8LE, H5T_STD_I16BE, ...
- floating point type
- H5T_IEEE_F32BE, H5T_IEEE_F32LE, H5T_IEEE_F64BE, ...
- string type
- compound type
- named, unamed and transient compound type
- integer, floating or string type member
- reference type
- object references
- data regions
- enum type
- Data space
  - scalar and simple space
- Soft link
- Hard link
- Loop detection
See Also:
  HDF5 Data Description Language syntax (DDL for HDF5)

Tool Name: h5ls
Syntax:
  `h5ls [`options`]` file`[`objects...`]`
Purpose:
  Prints information about a file or dataset.
Description:
  `h5ls` prints selected information about file objects in the specified format.
Options and Parameters:

`-h` or `-?` or `--help`
  Print a usage message and exit.
`-d` or `--dump`
  Print the values of datasets.
`-w` N or `--width=`N
  Set the number of columns of output.
`-v` or `--verbose`
  Generate more verbose output.
`-V` or `--version`
  Print version number and exit.
file
  The file name may include a printf(3C) integer format such as `%%05d` to open a file family.
objects
  The names of zero or more objects about which information should be displayed. If a group is mentioned then information about each of its members is displayed. If no object names are specified then information about all of the objects in the root group is displayed.

Tool Name: h5repart
Syntax:
  `h5repart [-v] [-V] [-[b|m]`N`[g|m|k]]` source_file dest_file
Purpose:
  Repartitions a file or family of files.
Description:
  `h5repart` splits a single file into a family of files, joins a family of files into a single file, or copies one family of files to another while changing the size of the family members. `h5repart` can also be used to copy a single file to a single file with holes.

  Sizes associated with the `-b` and `-m` options may be suffixed with `g` for gigabytes, `m` for megabytes, or `k` for kilobytes.

  File family names include an integer `printf` format such as `%d`.

Options and Parameters:

`-v`
  Produce verbose output.
`-V`
  Print a version number and exit.
`-b` N
  The I/O block size, defaults to 1kB
`-m` N
  The destination member size or 1GB
source_file
  The name of the source file
dest_file
  The name of the destination files

Tool Name: h5toh4
Syntax:
  `h5toh4 -h`
  `h5toh4` h5file h4file
  `h5toh4` h5file
  `h5toh4 -m` h5file1 h5file2 h5file3 ...
Purpose:
  Converts an HDF5 file into an HDF4 file.
Description:
  `h5toh4` is an HDF5 utility which reads an HDF5 file, h5file, and converts all supported objects and pathways to produce an HDF4 file, h4file. If h4file already exists, it will be replaced.

  If only one file name is given, the name must end in `.h5` and is assumed to represent the HDF5 input file. `h5toh4` replaces the `.h5` suffix with `.hdf` to form the name of the resulting HDF4 file and proceeds as above. If a file with the name of the intended HDF4 file already exists, `h5toh4` exits with an error without changing the contents of any file.

  The `-m` option allows multiple HDF5 file arguments. Each file name is treated the same as the single file name case above.

  The `-h` option causes the following syntax summary to be displayed:

                    h5toh4 file.h5 file.hdf
                    h5toh4 file.h5
                    h5toh4 -m file1.h5 file2.h5 ...

  The following HDF5 objects occurring in an HDF5 file are converted to HDF4 objects in the HDF4 file:

  - HDF5 group objects are converted into HDF4 Vgroup objects. HDF5 hardlinks and softlinks pointing to objects are converted to HDF4 Vgroup references.
  - HDF5 dataset objects of integer datatype are converted into HDF4 SDS objects. These datasets may have up to 32 fixed dimensions. The slowest varying dimension may be extendable. 8-bit, 16-bit, and 32-bit integer datatypes are supported.
  - HDF5 dataset objects of floating point datatype are converted into HDF4 SDS objects. These datasets may have up to 32 fixed dimensions. The slowest varying dimension may be extendable. 32-bit and 64-bit floating point datatypes are supported.
  - HDF5 dataset objects of single dimension and compound datatype are converted into HDF4 Vdata objects. The length of that single dimension may be fixed or extendable. The members of the compound datatype are constrained to be no more than rank 4.
  - HDF5 dataset objects of single dimension and fixed length string datatype are converted into HDF4 Vdata objects. The HDF4 Vdata is a single field whose order is the length of the HDF5 string type. The number of records of the Vdata is the length of the single dimension which may be fixed or extendable.
  Other objects are not converted and are not recorded in the resulting h4file.

  Attributes associated with any of the supported HDF5 objects are carried over to the HDF4 objects. Attributes may be of integer, floating point, or fixed length string datatype and they may have up to 32 fixed dimensions.

  All datatypes are converted to big-endian. Floating point datatypes are converted to IEEE format.

Options and Parameters:

`-h`
  Displays a syntax summary.
`-m`
  Converts multiple HDF5 files to multiple HDF4 files.
h5file
  The HDF5 file to be converted.
h4file
  The HDF4 file to be created.

Introduction to HDF5 HDF5 User Guide Other HDF5 documents and links | And in this document, the HDF5 Reference Manual H5 H5A H5D H5E H5F H5G H5I H5P H5R H5RA H5S H5T H5Z Tools

HDF Help Desk
Last modified: 29 April 1999