Adding attributes to a Compound DS


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”.

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.

How can I save the string values?


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: