How do people use H5S_NULL?

Hi all,

I am looking for information on the real-world use of the H5S_NULL
dataspace flavor. My question was sparked by this discussion on the
h5py mailing list:

https://groups.google.com/forum/?fromgroups=#!topic/h5py/jbZmsUmDbdo

We are trying to figure out what to do at a high level in Python when
reading a string attribute created with H5S_NULL. Right now the two
main choices are to return an empty string, or to fail with an error.

Both have their merits but I thought I'd ask how other programs handle
this, e.g. Java, C++, etc. In the HDF5 C interface, it's legal to
perform a read from NULL -> SCALAR, but obviously nothing actually
happens (the output buffer is untouched).

I am particularly interested if H5S_NULL is being commonly used "in
the wild" as shorthand for an empty string.

Thanks!
Andrew Collette

Andrew, what an interesting question! I can't answer the question, but would
like to add an observation that might help finding an answer.

HDF5 attributes and datasets represent different uses of what some would
refer
to as array variables. What is the value of such an array variable?

An (HDF5) array variable is characterized by its datatype (T) and dataspace
(S).
It's value is a function v: S -> T, or it's graph G(v) := [(s,t) in SxT |
v(s) = t] .
For H5S_NULL, S is the empty set. The graph (the value of the array
variable) is also
the empty set.

How a particular API deals with that is another matter. In my opinion, it
shouldn't
be an error to read the empty set.

G.

ยทยทยท

-----Original Message-----
From: Hdf-forum [mailto:hdf-forum-bounces@hdfgroup.org] On Behalf Of Andrew
Collette
Sent: Tuesday, March 19, 2013 2:32 PM
To: hdf-forum@hdfgroup.org
Subject: [Hdf-forum] How do people use H5S_NULL?

Hi all,

I am looking for information on the real-world use of the H5S_NULL dataspace
flavor. My question was sparked by this discussion on the h5py mailing
list:

https://groups.google.com/forum/?fromgroups=#!topic/h5py/jbZmsUmDbdo

We are trying to figure out what to do at a high level in Python when
reading a string attribute created with H5S_NULL. Right now the two main
choices are to return an empty string, or to fail with an error.

Both have their merits but I thought I'd ask how other programs handle this,
e.g. Java, C++, etc. In the HDF5 C interface, it's legal to perform a read
from NULL -> SCALAR, but obviously nothing actually happens (the output
buffer is untouched).

I am particularly interested if H5S_NULL is being commonly used "in the
wild" as shorthand for an empty string.

Thanks!
Andrew Collette

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