Python · Memory Operations

Memory Operations

import stringzilla 6.0.0-rc.1 · 91a27bdd

API

Types

FileMemory-mapped file class that exposes the memory range for low-level access.
__init__.pyi:320 ↗
class File

Provides efficient read-only access to file contents without loading into memory.

Examples

>>> import os, tempfile, pathlib
>>> path = os.path.join(tempfile.mkdtemp(), 'log.txt')
>>> _ = pathlib.Path(path).write_text('error: disk full\nok\nerror: timeout\n')
>>> # Memory-map and scan in place - no copy into RAM, SIMD-accelerated:
>>> sz.String(sz.File(path)).count('error')
2