I agree it is difficult to know when HDF5 has indeed closed a file due
to the possibility of having left resources associated with a file open.

There are some things you can do to make it easier.

First, when you call H5Fopen, build a non-default prop. list that uses
H5Pset_fclose_degree(fapl, H5F_CLOSE_SEMI) property.

That way, H5Fclose will return error if it was unable to indeed close
the file.

Also, just prior to calling H5Fclose, can use H5Fget_obj_count to
confirm whether or not you have left any open objects in the file.
However, I don't think thats foolproof as I think may neglect to include
uncommitted datatypes (maybe thats just a memory resource though and
won't prevent closing of the file).

Mark

On Thu, 2013-01-31 at 15:42 -0300, Andy Voelkel wrote:
> Hi Gerd,
> 
>  
> 
> I found the problem. It was an attribute resource that had not been
> closed. You have to very careful with this!
> 
>  
> 
> Thanks much – I’m off and running.
> 
>  
> 
> -          Andy
> 
>  
> 
> From: Hdf-forum [mailto:[email protected]] On Behalf Of
> Gerd Heber
> Sent: Wednesday, January 30, 2013 7:32 PM
> To: 'HDF Users Discussion List'
> Subject: Re: [Hdf-forum] HDF.close doesn't seem to close - subsequent
> open throws an exception
> 
> 
>  
> 
> Andy, I think it’s a problem in a part of your code that we can’t see.
> 
> Have a look at the attached sample, which creates the same file 
> 
> 10 times in a loop without causing the problem you’re seeing.
> 
>  
> 
> Best, G.
> 
>  
> 
>  
> 
> 
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> [email protected]
> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
-- 
Mark C. Miller, Lawrence Livermore National Laboratory
================!!LLNL BUSINESS ONLY!!================
[email protected]      urgent: [email protected]
T:8-6 (925)-423-5901    M/W/Th:7-12,2-7 (530)-753-8511


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

Reply via email to