Closed evaneschneider closed 9 months ago
From personal experience, writing strings to HDF5 files is a PITA. Here's the code for it so no one has to struggle like I did
attribute_id = H5Acreate(file_id, "HEADER ATTRIBUTE NAME", stringType, dataspace_id, H5P_DEFAULT, H5P_DEFAULT);
// STRING_TO_WRITE needs to be of type const char *.
// There's probably a way to get that type out of a std::string with the .data() method
status = H5Awrite(attribute_id, stringType, &STRING_TO_WRITE);
H5Aclose(attribute_id);
Resolved in PR #341
In order to make the yt cholla frontend more robust, it would be useful to have a header attribute in cholla output files uniquely identifying them as cholla datasets. I suggest adding the header attribute 'cholla' to achieve this purpose.