mmap

The mmap module provides support for a memory-mapped file object. This object behaves both like a file and a string and can be used in most places where an ordinary file or string is expected. Furthermore, the contents of a memory-mapped file are mutable. This means that modifications can be made using index-assignment and slice-assignment operators. Unless a private mapping of the file has been made, such changes directly alter the contents of the underlying file.

A memory-mapping file is created by the mmap() function, which is slightly different on UNIX and Windows.

mmap(fileno, length [, flags, [prot [,access]])

(UNIX) Returns an mmap object that maps length bytes from the file with an integer file descriptor, fileno. flags specifies ...

Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.