pyarrow.create_memory_map#

pyarrow.create_memory_map(path, size)#

Create a file of the given size and memory-map it.

Parameters:
pathstr

The file path to create, on the local filesystem.

sizeint

The file size to create.

Returns:
mmapMemoryMappedFile

Examples

Create a file with a memory map:

>>> import pyarrow as pa
>>> with pa.create_memory_map('example_mmap_create.dat', 27) as mmap:
...     mmap.write(b'Create a memory-mapped file')
...     mmap.read_at(10, 9)
...
27
b'memory-map'