H5Ocopy and object references

Hi everyone,

I am using H5Ocopy to copy groups with lots of subgroups and datasets,
which include datasets and attributes containing object references.
The references point to objects that are also inside the group that is
being copied. The copy happens between two files.

What I would like to have as a result is a tree in the destination
file in which all object references point to the freshly made copies
of what the references in the source group pointed to. That's not what
happens, I get invalid object references.

From the documentation it is not clear to me what the expected

behavior is, nor if there is any way to get the behavior I need. The
documentation for H5Ocopy doesn't mention references at all. The
documentation for H5Pset_copy_object says that the default behavior,
in the absence of H5O_COPY_EXPAND_REFERENCE_FLAG, is "Update only the
values of object references", which sounds a bit like what I expect,
but it is not said explicitly to what value they references are
updated.

Can anyone shed some light on this?

Thanks,
  Konrad.

Hi Konrad,

Our documentation is misleading. We will correct it. The comments in our
source code are more accurate (see below):

  * H5O_COPY_EXPAND_REFERENCE_FLAG
  * 1) Copy object between two different files:
  * When this flag is specified, it will copy objects that
  * are pointed by the references and update the values of
  * references in the destination file. Otherwise (default)
  * the values of references in the destination will set to
  * zero

You will need to set the flag if you need to update the references in the new file.

···

On 6/13/2013 3:10 AM, Konrad Hinsen wrote:

Hi everyone,

I am using H5Ocopy to copy groups with lots of subgroups and datasets,
which include datasets and attributes containing object references.
The references point to objects that are also inside the group that is
being copied. The copy happens between two files.

What I would like to have as a result is a tree in the destination
file in which all object references point to the freshly made copies
of what the references in the source group pointed to. That's not what
happens, I get invalid object references.

>From the documentation it is not clear to me what the expected
behavior is, nor if there is any way to get the behavior I need. The
documentation for H5Ocopy doesn't mention references at all. The
documentation for H5Pset_copy_object says that the default behavior,
in the absence of H5O_COPY_EXPAND_REFERENCE_FLAG, is "Update only the
values of object references", which sounds a bit like what I expect,
but it is not said explicitly to what value they references are
updated.

Can anyone shed some light on this?

Thanks,
   Konrad.

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

That clarifies the situation. Thanks a lot!

Konrad.

···

--On 14 juin 2013 14:02:29 -0500 Peter Cao <xcao@hdfgroup.org> wrote:

Our documentation is misleading. We will correct it. The comments in our
source code are more accurate (see below):