Hi Florian,

A Saturday 08 May 2010 03:20:37 escriguéreu:
> Subject: PyTables: multiple open filehandles
> From: Florian Schroff <gschr...@cs.ucsd.edu>
> To: pytables-users@lists.sourceforge.net
> Date: Saturday 02:45:33
>
> Hi,
> I just realized that closing one of multiple open (readonly) filehandles
> closes all other filehandles:
> 
> fh=openFile(...)
> fh2=openFile(...)
> fh.close()
> fh,fh2 are both closed.
> 
> Is this a bug or should that be expected behavior?

This is the expected behavior.  In the current implementation in trunk, re-
opening a file always returns the already-opened handler, so closing any of 
the handler, will automatically close all the others.  You can use the 
`File.isopen` attribute in order to determine if the status of the file 
handler and re-open it manually, if necessary.

This is not the same behaviour as `open()` in Python, but at least the above 
behaviour allows to re-open the same file many times.

Cheers,

[PS: Next time please write to the list from a subscribed address.  Thanks!]

-- 
Francesc Alted

------------------------------------------------------------------------------

_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to