标签:
with open(‘??‘, ‘r+b‘) as f: with contextlib.closing(mmap.mmap(f.fileno(), size, flags=mmap.MAP_SHARED, access=mmap.ACCESS_WRITE)) as mm: mm = ?? mm.flush()
>>> mmap.ACCESS_READ
1
>>> mmap.ACCESS_WRITE
2
>>> mmap.ACCESS_COPY
3
>>> mmap.ACCESS_READ | mmap.ACCESS_WRITE
3
In other words, access=mmap.ACCESS_READ|mmap.ACCESS_WRITE
is the same as access=mmap.ACCESS_COPY
. What you want is most likely access=mmap.ACCESS_WRITE
, and on Windows that‘s what you get anyway if you don‘t explicitly use that argument.
标签:
原文地址:http://www.cnblogs.com/lulu147/p/5021097.html