I'm having a problem using H5Aopen_by_name with a group name. I'm using
HDF5 1.8.16.

Doesn't work:
    auto aid = H5::H5Aopen_by_name(file_id, "g1", "a1", H5::H5P_DEFAULT,
H5::H5P_DEFAULT);
    int v = 6;
    auto r = H5::H5Awrite(aid, type_id, &v);  // returns -1

Works:
    auto group_id = H5::H5Gopen(file_id, "g1", H5::H5P_DEFAULT);
    auto aid = H5::H5Aopen_by_name(group_id, ".", "a1", H5::H5P_DEFAULT,
H5::H5P_DEFAULT);
    int v = 6;
    auto r = H5::H5Awrite(aid, type_id, &v); // returns 0
_______________________________________________
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