Hi Rob,
Thanks for the tip! That might save me some trouble later on.
Cheers, Martijn

On 23 July 2013 23:14, Rob Latham <[email protected]> wrote:

> On Tue, Jul 23, 2013 at 12:41:05PM +1000, Martijn Jasperse wrote:
> > Hi Dana,
> > Thanks for the explanation - I jumped at a false positive! My "minimal
> > example" was perhaps a bit too minimal; not enough coffee leads to bad
> > conclusions. I'll continue to probe the rest of my code, no doubt it's a
> > missing H5*close somewhere.
>
> If you need help tracking down these resources, here is some code.  You
> probably need to change 'fp' to whatever identifier you are using for HDF5
> files.
>
> -------------------------------------
>     ssize_t norphans;
>     norphans = H5Fget_obj_count(fp, H5F_OBJ_ALL);
>     if (norphans > 1) { /* expect 1 for the file we have not closed */
>         int i;
>         H5O_info_t info;
>         char name[64];
>         hid_t * objects = calloc(norphans, sizeof(hid_t));
>         H5Fget_obj_ids(fp, H5F_OBJ_ALL, -1, objects);
>         for (i=0; i<norphans; i++) {
>             H5Oget_info(objects[i], &info);
>             H5Iget_name(objects[i], name, 64);
>             printf("%d of %zd things still open: %d with name %s of type
> %d",
>                   i, norphans, objects[i], name, info.type);
>         }
>         free(objects);
>     }
> -------------------------------------
>
> ==rob
>
>
> --
> Rob Latham
> Mathematics and Computer Science Division
> Argonne National Lab, IL USA
>
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> [email protected]
>
> http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
>
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Reply via email to