Maximum comment length?

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

Rhys Ulerich wrote:

Me again,

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

Hi Rhys,

I reported this bug several weeks ago, so I think the answer is "there is no switch to fix it."

Actually, I don't understand the reason for the existence of the object comment facility. Is there a substantive difference between a comment and an HDF5 attribute called, say, "COMMENT"?

--dan

···

--
Daniel Kahn
Science Systems and Applications Inc.
301-867-2162

There is a bug report on which the h5dump can't print comment correctly. One of us is working on it. Actually, the library has deprecated comment in favor of attribute. So you're encouraged to use object attribute. The reference manual will reflect this change for the 1.8.6 release.

Thanks.

Ray

···

On Feb 11, 2011, at 2:20 PM, Daniel Kahn wrote:

Rhys Ulerich wrote:

Me again,

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

Hi Rhys,

I reported this bug several weeks ago, so I think the answer is "there is no switch to fix it."

Actually, I don't understand the reason for the existence of the object comment facility. Is there a substantive difference between a comment and an HDF5 attribute called, say, "COMMENT"?

--dan

--
Daniel Kahn
Science Systems and Applications Inc.
301-867-2162

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

Hi Daniel and Ray,

I've noticed that h5dump seems to truncate comments.

I reported this bug several weeks ago, so I think the answer is "there is no
switch to fix it."

One of us is working on it.

Thank you!

Actually, I don't understand the reason for the existence of the object
comment facility. Is there a substantive difference between a comment and
an HDF5 attribute called, say, "COMMENT"?

Functionally, nothing. Conceptually, lots. Comments are for humans
and attributes are for machines. Analogously, in C-speak one could
claim that both of

A) static const char cmt1[] = "Some pertinent comment";
B) /* Some pertinent comment */

are functionally equivalent. Obviously, they're conceptually quite
distinct. Fortunately, the C language folks decided to not make
programmers simulate comments via other language functionality.

Actually, the library has deprecated comment in favor of attributes.

Say it ain't so! There's unlimited goodness to be gained by having an
unambiguous comment facility!

- Rhys

Hi Rhys,

Hi Daniel and Ray,

I've noticed that h5dump seems to truncate comments.

I reported this bug several weeks ago, so I think the answer is "there is no
switch to fix it."

One of us is working on it.

Thank you!

Actually, I don't understand the reason for the existence of the object
comment facility. Is there a substantive difference between a comment and
an HDF5 attribute called, say, "COMMENT"?

Functionally, nothing. Conceptually, lots. Comments are for humans
and attributes are for machines. Analogously, in C-speak one could
claim that both of

A) static const char cmt1[] = "Some pertinent comment";
B) /* Some pertinent comment */

are functionally equivalent. Obviously, they're conceptually quite
distinct. Fortunately, the C language folks decided to not make
programmers simulate comments via other language functionality.

Actually, the library has deprecated comment in favor of attributes.

Say it ain't so! There's unlimited goodness to be gained by having an
unambiguous comment facility!

Noted. We will revisit the issue and update our docs.

Elena

···

On Feb 11, 2011, at 3:05 PM, Rhys Ulerich wrote:

- Rhys

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