Ok, a few more things...perhaps someone with a bit of python knowledge
might be able to shed some light on this. There is a simple way of fixing this
by writing a custom mmap.py so everything is done transparently; however, I
think I am missing a few things.
def simple_mmap(f, offset, size, access=mmap.ACCESS_READ):
"""Simple wrapper for mmap() which always supports the offset parameter.
mem = mmap.mmap(f.fileno(), size+offset, access=access)
the above def is the one that we have to be taking into account there is
another in pack.py that I've resolved by my mmap.py below:
import os
def mmap(fd, len, *args):
return os.read(fd, len)
#garbage to take into account access field
#which here, is always read...
ACCESS_READ = 0
can someone else take a look at the dulwich code which can be found in the
hg-git bitbucket repository:
http://bitbucket.org/abderrahim/hg-git/
and take a look at those functions that call simple_mmap -- it seems to me the
only thing to take into account is offset and we can do this via
file.seek(offset) before calling this simple mmap implementation.
i actually don't think that this seek is nessary since it seems its taken into
account in the size+offset line -- though i guess we need to _get_ to offset in
the file first
respectfully,
++james