Me again,

I've noticed that h5dump seems to truncate comments.  On 1.8.5-patch1
the code like

    char buf[] =
"abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";

    // Write comment to new file
    const hid_t f = H5Fcreate(
            "foo.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
    hsize_t dims = 1;
    int dat = 5;
    H5LTmake_dataset_int(f, "x", 1, &dims, &dat);
    H5Oset_comment_by_name(f, "x", buf, H5P_DEFAULT);
    H5Fclose(f);

    // Clear buf
    memset(buf, 0, sizeof(buf));
    puts(buf);

    // Re-open file read-only and read comment
    const hid_t g = H5Fopen("foo.h5", H5F_ACC_RDONLY, H5P_DEFAULT);
    H5Oget_comment_by_name(g, "x", buf, sizeof(buf), H5P_DEFAULT);
    puts(buf);
    H5Fclose(g);

generates a foo.h5 file for which h5dump shows

HDF5 "foo.h5" {
GROUP "/" {
   DATASET "x" {
   COMMENT "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMN"
      DATATYPE  H5T_STD_I32LE
      DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
      DATA {
      (0): 5
      }
   }
}
}
where the comment looks truncated.  The H5Oget_comment_by_name in the
program, however, confirms that the full comment is being set.

Is there a way to request that h5dump not truncate comments?

Thanks,
Rhys

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to