mmstats icon indicating copy to clipboard operation
mmstats copied to clipboard

mmap not usable from windows

Open Gloombloom opened this issue 13 years ago • 1 comments

Python 2.7.2

(mmstats) C:\REPO\mmstats>python mmstats\mmash.py Traceback (most recent call last): File "mmstats\mmash.py", line 11, in from mmstats import reader as mmstats_reader File "C:\REPO\mmstats\mmstats__init__.py", line 5, in from .models import * File "C:\REPO\mmstats\mmstats\models.py", line 6, in from . import fields, libgettid, mmap File "C:\REPO\mmstats\mmstats_mmap.py", line 47, in libc.mmap.restype = ctypes.c_void_p File "c:\Python27\Lib\ctypes__init_.py", line 366, in getattr func = self.getitem(name) File "c:\Python27\Lib\ctypes__init__.py", line 371, in getitem func = self._FuncPtr((name_or_ordinal, self)) AttributeError: function 'mmap' not found

Gloombloom avatar Mar 12 '12 18:03 Gloombloom

I've started a first attempt, but I don't have Windows handy to test it on:

https://github.com/schmichael/mmstats/compare/windows-mmap#L0R43

My guess is that 2 things will definitely need fixing:

  • I doubt the MapViewOfFile is in Window's C library implementation ... perhaps in kernel32?
  • msync and munmap will probably need fixing as well (although these functions could just be stubs on Windows as they're not 100% necessary)

schmichael avatar Mar 12 '12 19:03 schmichael