Delete / Insert Data in mmap'ed File

前端 未结 2 1493
一生所求
一生所求 2020-12-29 00:06

I am working on a script in Python that maps a file for processing using mmap().

The tasks requires me to change the file\'s contents by

  1. Replacing data
2条回答
  •  庸人自扰
    2020-12-29 00:47

    There is no way to shift contents of a file (be it mmap'ed or plain) without doing it explicitly. In the case of a mmap'ed file, you'll have to use the mmap.move method.

提交回复
热议问题