Hi Sturla, On Sat, Mar 14, 2009 at 12:23 PM, Sturla Molden <sturla@molden.no> wrote:
Will memmap be fixed to use offsets correctly before 1.3?
I posted this to scipy-dev (possibly wrong list) on March 9, so I'll repeat it here: In Python 2.6, mmap has a offset keyword. NumPy's memmap should use this to allow big files to be memory mapped on 32 bit systems. Only a minor change is required:
if float(sys.version[:3]) > 2.5:
bytes = bytes - offset
mm = mmap.mmap(fid.fileno(), bytes, access=acc, offset=offset)
self = ndarray.__new__(subtype, shape, dtype=descr, buffer=mm, offset=0, order=order)
else:
mm = mmap.mmap(fid.fileno(), bytes, access=acc)
self = ndarray.__new__(subtype, shape, dtype=descr, buffer=mm, offset=offset, order=order)
Instead of just:
mm = mmap.mmap(fid.fileno(), bytes, access=acc)
self = ndarray.__new__(subtype, shape, dtype=descr, buffer=mm, offset=offset, order=order)
Can you open a ticket for this? Chuck