Hi Mark,

On Jan 15, 2010, at 10:23 AM, Mark Howison wrote:

> Hi all,
> 
> I have a piece of code that checks for the existence of a group at
> "/Step#0" by calling this on the file id:
> 
> H5Gget_objinfo( file_id, name, 1, NULL );
> 
> I've tried both name="/Step#0" and name="Step#0". Also, I've tried
> 
> g_id = H5Gopen(file_id, "/");
> H5Gget_objinfo( g_id, name, 1, NULL );
> 
> but in all cases, I receive error messages of this type:
> 
> HDF5-DIAG: Error detected in HDF5 library version: 1.6.10 MPI-process
> 3.  Back trace follows.
>  #000: H5G.c line 753 in H5Gget_objinfo(): cannot stat object
>    major(01): Function arguments
>    minor(29): Unable to initialize object
>  #001: H5G.c line 2134 in H5G_get_objinfo(): unable to stat object
>    major(10): Symbol table layer
>    minor(48): Object not found
>  #002: H5Gtraverse.c line 397 in H5G_namei(): component not found
>    major(10): Symbol table layer
>    minor(48): Object not found
>  #003: H5Gstab.c line 161 in H5G_stab_find(): not found
>    major(10): Symbol table layer
>    minor(48): Object not found
> 
> When using 1.8.x, we skip H5Gget_objinfo all together and use
> H5Lexists instead, but we would like to maintain compatibility with
> 1.6.x.

        Yes, H5Gget_objinfo() is not very well designed for this purpose, but 
it's also the only tool available prior to the new APIs in 1.8.x release.  One 
solution that has worked in an OK manner is to use the 
H5E_BEGIN_TRY/H5E_END_TRY macros around the call to H5Gget_objinfo(), so that 
the error stack is suppressed when the object doesn't exist.

        Quincey

> Thanks
> Mark
> 
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> Hdf-forum@hdfgroup.org
> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


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

Reply via email to