Merge pull request #184 from geospatial-jeff/178-read-mode

open mmap with ACCESS_READ
This commit is contained in:
Brandon Liu
2023-05-29 11:20:13 +08:00
committed by GitHub

View File

@@ -12,7 +12,7 @@ import gzip
def MmapSource(f): def MmapSource(f):
mapping = mmap.mmap(f.fileno(), 0) mapping = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
def get_bytes(offset, length): def get_bytes(offset, length):
return mapping[offset : offset + length] return mapping[offset : offset + length]