On 29/04/2011 3:36 PM, Quincey Koziol wrote:
On Apr 29, 2011, at 2:23 PM, Konrad Hinsen wrote:
On 29 Apr 2011, at 18:19, Mark Kelly wrote:
Does anyone know how to retrieve the parent group from an open dataset or open
child group? In other words, navigate 'backwards' from a child to the parent.
You can ask for the path to the node you have (H5Rget_name) and strip away the
last part. Note that due to the complexities introduced by links and
references, a node can have multiple names or even none at all, but in most
practical situation this approach should work fine.
Yes, that may work (probably with H5Iget_name, though) in many cases. The limitation here
is that since an HDF5 groups/datasets/etc may have multiple hard links to it (i.e. have multiple
"parents"), we don't store any "parent" information on objects.
Quincey
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
Hi,
Thanks for the reply. H5Iget_name worked perfectly. H5Rget_name was only
introduced in 1.8.0 (I am using 1.6).
In my case, there will only be one hard link to the dataset, so
practically it's ok.
Also noted from the docs: When possible,|H5Iget_name|returns the path
with which the object was opened, so it may also work if ever multiple
links to it but only one path was used to open it.
Thanks again!
--
Mark Kelly
NexGen Ergonomics Inc.
(514) 685-8593
www.nexgenergo.com
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org