Why doesn't Python's mmap work with large files?

后端 未结 8 1186
遇见更好的自我
遇见更好的自我 2020-12-01 05:11

[Edit: This problem applies only to 32-bit systems. If your computer, your OS and your python implementation are 64-bit, then mmap-ing huge files works reliably and

8条回答
  •  鱼传尺愫
    2020-12-01 05:45

    The point you are missing is that mmap is a memory mapping function that maps a file into memory for arbitrary access across the requested data range by any means.

    What you are looking for sounds more like some sort of a data window class that presents an api allowing you to look at small windows of a large data structure at anyone time. Access beyond the bounds of this window would not be possible other than by calling the data window's own api.

    This is fine, but it is not a memory map, it is something that offers the advantage of a wider data range at the cost of a more restrictive api.

提交回复
热议问题