Use mmap in a portable way

This commit is contained in:
René Stadler 2008-11-29 21:00:20 +02:00 committed by Stefan Sauer
parent 984549d45a
commit 7dcd3db661

View file

@ -323,7 +323,7 @@ class LogFile (Producer):
self.path = os.path.normpath (os.path.abspath (filename))
self.__real_fileobj = file (filename, "rb")
self.fileobj = mmap.mmap (self.__real_fileobj.fileno (), 0, prot = mmap.PROT_READ)
self.fileobj = mmap.mmap (self.__real_fileobj.fileno (), 0, access = mmap.ACCESS_READ)
self.line_cache = LineCache (self.fileobj, dispatcher)
self.line_cache.consumers.append (self)