* [9fans] hg-git on plan9
@ 2009-07-17 20:40 drivers
0 siblings, 0 replies; only message in thread
From: drivers @ 2009-07-17 20:40 UTC (permalink / raw)
To: 9fans
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-07-17 20:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-17 20:40 [9fans] hg-git on plan9 drivers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).