Jack Andrews wrote:
>> When a file is mapped, the view (size) of the map must fit in RAM.
>
> i'm sure this is not right. i created a small ubuntu guest vm with
> 512MB ram and here's a python program that succeeds.
>
> import mmap,os
>
> SIZE=600*1024*1024
> f=os.tmpfile()
> print dir(f)
> f.truncate(SIZE)
> mm=mmap.mmap(f.fileno(),SIZE)
> mm.seek(0)
> mm.write("abc")
> mm.seek(SIZE-5)
> mm.write("012")
Correct, I had noticed this recently, and forgot! But the same problem
remains - that map does map all the file and this won't work for an
arbitrary large file. You would need to fix the map function for that.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm