HDF5 Command line tool h5ls - output fix with -S option

Hi all,

The 'h5ls' with '-S' option displays ambiguous output for nested compound
type in a compound type dataset.

For example,

Current output from "h5ls -ldS " looks like below:

comp2 Dataset {2}


        a_int=20 a_float=20.2 comp1=b_int=10 b_float=10.1

        a_int=21 a_float=21.21 comp1=b_int=11 b_float=11.11

Expected output from "h5ls -ldS " after fix:

comp2 Dataset {2}


        {a_int=20 a_float=20.2 comp1={b_int=10 b_float=10.1}}

        {a_int=21 a_float=21.21 comp1={b_int=11 b_float=11.11}}

This is based on the correct output without -S option as shown below :

Output from "h5ls -ld " :

comp2 Dataset {2}


        (0) {a_int=20, a_float=20.2, comp1={b_int=10, b_float=10.1}},

        (1) {a_int=21, a_float=21.21, comp1={b_int=11, b_float=11.11}}

For the reference, below shows h5dump output of the example dataset with
nested compound used for the above outputs .

GROUP "/" {

   DATASET "comp2" {


         H5T_STD_I32LE "a_int";

         H5T_IEEE_F32LE "a_float";

         H5T_COMPOUND {

            H5T_STD_I32LE "b_int";

            H5T_IEEE_F32LE "b_float";

         } "comp1";


      DATASPACE SIMPLE { ( 2 ) / ( 2 ) }

      DATA {

      (0): {








      (1): {











This is obvious bug and HDF tool team plan to add this fix as part of HDF5
1.8.6 release; however we would like to survey if this output change could
cause any problem for your site.

Let us know if you have any issue with this output fix?

According to the feedback, we will decide either pursuing the fix for the
next release or adding another command line option for this fix in 1.8 and
remove the option in 1.10 release later.


- HDF5 tool team