En/na Francesc Altet ha escrit:: > A Dijous 23 Març 2006 19:29, Andrew Straw va escriure: > [...] >>Also, in a rather similar email thread a couple weeks ago (titled >>"corrupt HDF5 files"), Ivan suggested, "you could try to explicitly >>close each of the leaves you have open (without closing the file >>itself)". What methods would I call to do this? Is this File.flush() or >>is there something more? > > Yes, for closing nodes there is the method Node._f_close() (or > Leaf.close() which is equivalent). Closing a node is a good way to > ensure that you force a flush on data belonging to this node (and only > that), so reducing the risk. > [...]
Just one warning: after closing a node for this purpose, you need to
ensure that no references (variables) still point to it, if you want to
use it again. This allows the LRU system to preempt the node from
memory, so that the next time you use it, it is opened and loaded anew.
If you kept a reference to it after closing, the next time you used the
node you would find it is closed, because it would be the exact same
object as before! :)
(Yeah, the LRU system has some subtleties like that; fortunately they
are quite straightforward.)
::
Ivan Vilata i Balaguer >qo< http://www.carabos.com/
Cárabos Coop. V. V V Enjoy Data
""
signature.asc
Description: OpenPGP digital signature
