Expand description
ZSTD compression and transparent decompression for files
Traits§
Functions§
- compress_
file - If quiet is false, lets messaging by the
zstdtool show up on stdout/err. If true, silences reporting output but captures error messages and reports those in the resulting error. - decompressed_
file - Transparently decompress zstd files if they have a .zstd suffix;
after that, expecting the
expected_suffix(which must be given without a leading dot) if given. - decompressed_
file_ mmap - Open the file as a mmap.
.zstdfiles are first decompressed touncompressed_path(or.zstd.uncompressedif not given) if the path does not exist already. The MMap is created using 2MB huge-pages on Linux. The usual caveats for memory maps applies: modifications of the file while using the map can change the data during parsing, which is safe or not depending on the parser. Truncating the file while accessing it will segfault the process. Leaving it marked safe here, for now.