[Numpy-discussion] memmap close() and flush()
oliphant at ee.byu.edu
Wed Jan 31 12:47:40 EST 2007
Fernando Perez wrote:
>On 1/31/07, Travis Oliphant <oliphant.travis at ieee.org> wrote:
>>Sebastian Haase wrote:
>>>Do numpy memmap have a way of explicitly
>>>flushing data to disk
>>>closing the memmap.
>>There is a sync method that performs the flush. To close the memmap,
>> The memmap sub-class has a _mmap attribute that is the Python
>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
More information about the NumPy-Discussion