Hi Rhys,
On Sep 14, 2011, at 10:12 AM, Rhys Ulerich wrote:
> 'Morning,
>
> I've noticed (from trying it and then reading the 1.8.7 source in
> H5A.c) that H5Aopen seemingly never returns H5E_NOTFOUND. The logic
> that I suspect should return H5E_NOTFOUND instead returns
> H5E_CANTINIT:
>
> /* Read in attribute from object header */
> if(NULL == (attr = H5O_attr_open_by_name(loc.oloc, attr_name,
> H5AC_ind_dxpl_id)))
> HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to load
> attribute info from object header")
>
> Should that HGOTO_ERROR line employ H5E_NOTFOUND? How about the one
> following it commented with "Finish initializing attribute"? Otherwise
> a caller of H5Aopen cannot distinguish between a non-existent
> attribute and other sorts of errors without an auxiliary call to
> H5Aexists...
Yes, we should tweak that, but really it's best to use H5Aexists first,
if the application isn't certain that the attribute should exist. Making the
application parse the error stack is prone to complexity and possible
misinterpretation (as you note! :-).
Quincey
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org