Rafal, this might be a bug. However, if you don't intend to store
data there's a cheaper and maybe less contorted option: You can
create a dataset with a dataspace of class H5S_NULL.
Think of that as a dataset whose dataspace is an empty set.
(Likewise you'd use H5S_SCALAR for a singleton.)

Best, G.

-----Original Message-----
From: Hdf-forum [mailto:[email protected]] On Behalf Of 
Rafal Lichwala
Sent: Thursday, October 26, 2017 3:00 AM
To: [email protected]
Subject: [Hdf-forum] HDF5 library bug or feature?

Hi All,

I've just discovered that when I create a dataset with one dimension which has 
a size = 0, then I cannot properly open such dataset -
H5Dopen() returns -1.
But when I create similar dataset with one dimension which has a size at least 
1 (even without writing data to such dataset), then I can properly open such 
dataset.

Is this a bug or a feature in the HDF5 library?

I think I should be able to open 0-size dimension dataset, just to create an 
attribute inside such dataset - and that was my intension - no data inside 
(thus dimension size = 0), but write some attributes to such dataset...

Best regards,
Rafal

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Reply via email to