Hello!
Using the C library on a POSIX platform, how do I get the prefix of a visited external link?
I call H5Lvisit
, and then my callback function with arguments (hid_t group, const char *name, const H5L_info_t *info, void *op_data)
is called for each link, and I can select only external links by testing for info->type == H5L_TYPE_EXTERNAL
. But how do I get the prefix, if any, for the external link?
I’ve read the documentation for H5Lget_val()
, and it says that for external links the lapl_id
argument needs to be a non-default link access property list because an external link may require a prefix. It references H5Pset_elink_prefix()
, but I don’t want to set it, I want to get it. I see there’s an H5Pget_elink_prefix()
function as well, which looked promising, but its arguments are (hid_t plist_id, char *prefix, size_t size)
, and I don’t know what I’m supposed to use for the plist_id
argument; should I use the group
argument of my callback function? Where is the prefix stored?
What I’m ultimately trying to do is rename the filename that the external link points to, so I’m deleting the external link and creating a new one with the new filename, but I want to ensure that I don’t lose the prefix if one is set.
Thanks!