[NeXus-tech] Nexus C++ API by DESY

Wintersberger, Eugen eugen.wintersberger at desy.de
Wed Feb 22 22:25:22 GMT 2012


Thanks for the response. Besides some other issues where I definitely
made a mistake ("units" and "unit", etc.) this character string issue
somehow puzzles me.

Here is the code that produces the string type for HDF5 (1.8.4):

 template<> H5Datatype H5DatatypeFactory::create_type<String>()
 {
     hid_t tid;
     tid = H5Tcopy(H5T_C_S1);
     H5Tset_strpad(tid,H5T_STR_NULLTERM);
     H5Tset_cset(tid,H5T_CSET_UTF8);
     //always use variable strings
     H5Tset_size(tid,H5T_VARIABLE);

     return H5Datatype(tid);
 }

When I have a look on the HDF5_version attribute with h5ls - I usually
use this tool - I get something this


Opened "d4_test.h5" with sec2 driver.
/                        Group
    Attribute: HDF5_version scalar
        Type:      variable-length null-terminated UTF-8 string
        Data:  "1.8.4"

which is exactly what I would expect. However, using h5dump confirms
Freddies comment that CSET is unknown. This is somehow strange.

Any ideas?

regards
   Eugen



More information about the NeXus-tech mailing list