Hi,

I don't understand why the following code returns an error (hdf5 version is 1.8.8 with Debian testing):

#include <hdf5.h>
#include <stdio.h>

int main(int argc, char ** argv)
{
hid_t file = H5Fcreate("/tmp/plop.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
    H5Lcreate_soft("abc", file, "def", H5P_DEFAULT, H5P_DEFAULT);
    H5Fclose(file);

    file = H5Fopen("/tmp/plop.h5", H5F_ACC_RDONLY, H5P_DEFAULT);
    hid_t root = H5Gopen2(file, "/", H5P_DEFAULT);
    H5G_info_t info;
    herr_t err = H5Gget_info(root, &info);
    hsize_t i = 0;

    printf("nlinks=%i\n", info.nlinks);

    for (; i < info.nlinks; i++)
    {
    H5O_info_t objinfo;
err = H5Oget_info_by_idx(root, ".", H5_INDEX_NAME, H5_ITER_INC, i, &objinfo, H5P_DEFAULT);
    printf("addr=%u\n", objinfo.addr);
    }

    H5Gclose(root);
    H5Fclose(file);

    return 0;
}

Is it a bug ? or is a link not an object ?

Thanks

Calixte

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to