Making a copy of link/reference

Hello everyone,
I am just discovering behavior of HDF links (H5L) and references (H5R) in
HDFView (2.10.1). I have noticed the following:

1) Copy of a link [unexpected behavior]
When I create a (hard) link (lets say "link1") to an object ("object1")
using "New -> Link" and make a copy of it ("copy1") using "Copy/Paste",
HDFView makes a copy of the object1 instead of making copy of the link1.
Eventual modification of object1 will reflect in link1 but not in the copy1.

2) Copy of an object reference (dataset) [expected behavior]
When I create a dataset with (object) reference datatype and make a copy of
it, the copy contains reference(s) to the original object(s) (same numbers).

3) Copy of an object containing an object reference (attribute) [unexpected
behavior]
3a) dataset
When I create a dataset containing an attribute of type (object) reference
and make a copy of that dataset, HDFView makes:
- a copy of the dataset containing attribute of type reference with
different value [new reference id]
- a copy of the referenced object ~obj_pointed_by_[new reference id] in the
root of the file
3a) group
When I create a group with an attribute of type reference and make a copy
of the group, value of the attribute is set to zero in the copy.

I have attached an example file.
Is that all expected behavior? It seems strange to me.

Best regards,
Vladimir Sedenka

H5L_H5R_copy.h5 (12.7 KB)

Vladimir,

We will investigate this issue to determine what the expectation and
implementation should be and update the documentation.

Thank you for bringing this to our attention,
Allen

···

On Friday, January 23, 2015 04:05:26 PM Vladimír Šeděnka wrote:

Hello everyone,
I am just discovering behavior of HDF links (H5L) and references (H5R) in
HDFView (2.10.1). I have noticed the following:

1) Copy of a link [unexpected behavior]
When I create a (hard) link (lets say "link1") to an object ("object1")
using "New -> Link" and make a copy of it ("copy1") using "Copy/Paste",
HDFView makes a copy of the object1 instead of making copy of the link1.
Eventual modification of object1 will reflect in link1 but not in the copy1.

2) Copy of an object reference (dataset) [expected behavior]
When I create a dataset with (object) reference datatype and make a copy of
it, the copy contains reference(s) to the original object(s) (same numbers).

3) Copy of an object containing an object reference (attribute) [unexpected
behavior]
3a) dataset
When I create a dataset containing an attribute of type (object) reference
and make a copy of that dataset, HDFView makes:
- a copy of the dataset containing attribute of type reference with
different value [new reference id]
- a copy of the referenced object ~obj_pointed_by_[new reference id] in the
root of the file
3a) group
When I create a group with an attribute of type reference and make a copy
of the group, value of the attribute is set to zero in the copy.

I have attached an example file.
Is that all expected behavior? It seems strange to me.

Best regards,
Vladimir Sedenka