[Hdf-forum] creating and writing to a subgroup fails

Martijn Jasperse m.jasperse at gmail.com
Fri Aug 5 18:43:50 CDT 2016


Hi Michael,
Based on your code, you're creating two top level groups, not a sub-group
as you want to. Presumably it should read

_subgroup = Group(_group.createGroup("/bar"));

Because at the moment your code says _file.createGroup(). Hence the dataset
creation fails.

Cheers,
Martijn

El 6/8/2016 5:14, "Michael Barrucco" <mbarrucco at gmail.com> escribió:

> Hi Folks:
>
> Im trying to write data to a subgroup /foo/bar.
>
> groups created like this:
> _group = Group(_file.createGroup("/foo"));
> _subgroup = Group(_file.createGroup("/bar"));
>
> i set some attributes on _group, then try to open a dataset:
> const H5std_string dataset_name("/foo/bar/test");
>
> Then i know it fails here:
>     _dataset = _file.createDataSet(dataset_name,
>                                                 PredType::NATIVE_DOUBLE,
> mspace, cparms);
>
> Note, without the subgroup "bar", this works fine (creates and writes to
> the file under group 'foo').
>
> Here is the failure:
>
> HDF5-DIAG: Error detected in HDF5 (1.8.16) thread 0:
>   #000: H5D.c line 194 in H5Dcreate2(): unable to create dataset
>     major: Dataset
>     minor: Unable to initialize object
>   #001: H5Dint.c line 453 in H5D__create_named(): unable to create and
> link to dataset
>     major: Dataset
>     minor: Unable to initialize object
>   #002: H5L.c line 1638 in H5L_link_object(): unable to create new link to
> object
>     major: Links
>     minor: Unable to initialize object
>   #003: H5L.c line 1882 in H5L_create_real(): can't insert link
>     major: Symbol table
>     minor: Unable to insert object
>   #004: H5Gtraverse.c line 861 in H5G_traverse(): internal path traversal
> failed
>     major: Symbol table
>     minor: Object not found
>   #005: H5Gtraverse.c line 755 in H5G_traverse_real(): component not found
>     major: Symbol table
>     minor: Object not found
> terminate called after throwing an instance of 'H5::FileIException'
> *** Aborted
>
> Any thoughts?
>
> Thanks,
> Mike
>
> --
>
> "It is difficult to say what is impossible, for the dream of yesterday is
> the hope of today and the reality of tomorrow--Robert H. Goddard."
>
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> Hdf-forum at lists.hdfgroup.org
> http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
> Twitter: https://twitter.com/hdf5
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hdfgroup.org/pipermail/hdf-forum_lists.hdfgroup.org/attachments/20160806/88922951/attachment-0001.html>


More information about the Hdf-forum mailing list