Fernando Perez wrote:

>On 1/31/07, Travis Oliphant <[EMAIL PROTECTED]> wrote:
>  
>
>>Sebastian Haase wrote:
>>    
>>
>>>Hi!
>>>Do numpy memmap have a way of explicitly
>>>flushing data to disk
>>>and/or
>>>closing the memmap.
>>>
>>>      
>>>
>>There is a sync method that performs the flush.   To close the memmap,
>>delete it.
>>
>>More detail:
>>    The memmap sub-class has a _mmap attribute that is the Python
>>memory-map object.
>>    
>>
>
>Quick question out of ignorance: shouldn't the API offer an explicit
>close method?  The reason is that in python, doing 'del foo' doesn't
>ensure real deletion of the underlying object that  will fire the
>close methods, since you may easily have other names pointing to the
>same object.  Having an explicit, guaranteed way to call .close()
>sounds  like a good thing to me, but I may well be missing something.
>
>  
>
I don't know.  If you have other things pointing to it, should you 
really close it?

At any rate you have access to the mmap file through the _mmap 
attribute.  So, you can always do

self._mmap.close()

-Travis

_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to