feature request: H5LTget_attribute_vector_length()

Just a feature request since H5LT functions are supposed to be
convenience features. The H5LTget_attribute_xxxx() functions require you
to preallocate space for arrays of ints/chars/etc, and if you don't know
the array length ahead of time, there is no one single function that can
return the array length. (e.g. the "size" argument that was provided to
the corresponding call to H5LTset_attribute_xxxx())

The closest I can find is H5Aget_storage_size (in bytes, I think?
documentation doesn't make this clear) and then I divide by sizeof(xxxx)
where xxxx is the type in question... but get_storage_size() says it
returns the space *allocated* which I'm not sure is guaranteed to be the
size of the attribute actually stored. Or I can call H5Aget_space() and
then H5Sget_simple_extent_npoints().

Anyway, to me, this sort of cries out for a simple function call in H5LT
that returns the array length.

Just my 2c.

···

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

Jason,

Good point. I entered feature request into our bugs database.

Elena

···

On Apr 11, 2008, at 8:32 AM, Jason Sachs wrote:

Just a feature request since H5LT functions are supposed to be
convenience features. The H5LTget_attribute_xxxx() functions require you
to preallocate space for arrays of ints/chars/etc, and if you don't know
the array length ahead of time, there is no one single function that can
return the array length. (e.g. the "size" argument that was provided to
the corresponding call to H5LTset_attribute_xxxx())

The closest I can find is H5Aget_storage_size (in bytes, I think?
documentation doesn't make this clear) and then I divide by sizeof(xxxx)
where xxxx is the type in question... but get_storage_size() says it
returns the space *allocated* which I'm not sure is guaranteed to be the
size of the attribute actually stored. Or I can call H5Aget_space() and
then H5Sget_simple_extent_npoints().

Anyway, to me, this sort of cries out for a simple function call in H5LT
that returns the array length.

Just my 2c.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.