Adding attributes to a Compound DS


#1

I’ve added a Compound DS to my .h5 file, and I am adding VLEN_STRING attributes and values. When I save the file, the values for the strings are lost. For example, I create a Compound DS named “test”. I then right click Properties, click on the Attributes tab, and then Add. I name the property “Foo”, I set the type to VLEN_STRING, and the value to “Foo who”.
image

I go to File->Save, close the file and then reopen it. I right-click Show Properties on “test”, and my attribute “Foo” is there, but the value is blank.

image
How can I save the string values?


#2

This is a known HDFView bug that we plan to fix.

On the Examples by API page there is an example that shows how to create and write to variable length string attributes (at the very end) in case that helps. See:
https://portal.hdfgroup.org/display/HDF5/Examples+by+API