Expand description
A zip reader over miniz_oxide, for game-root overlays: what is in a package, and putting it on disk where it says. No entry is ever interpreted, and there is no writer, since backups are plain file copies.
Paths are /-separated on every host, because they are also the ledgerโs keys.
An archive and each entry are held in memory whole; real packages stay under 50 MB.
Modulesยง
- archive ๐
- central_
directory ๐ - crc32 ๐
- entry_
data ๐ - entry_
name ๐ - extraction ๐
- zip_
error ๐
Structsยง
- Archive
- A package whose central directory has been read once. Finding each file by walking the directory again cost an install of n files nยฒ entry parses: 8.5 s of a 12 s install at 3 000 files.
- File
Entry - One file a package will install.
- ZipError
- Readable as-is by the user.
Functionsยง
- entries
- The files a package will own, in zip order; directory entries are left out, since an empty directory is nothing to back up, record or delete.
- entry_
paths - extract
- Extracts into
dest_dir, overwriting existing files as the legacy installer did, and returns the files written in the formentry_pathsreports them. - read_
entry - One fileโs bytes, matched case-insensitively. Reading several from one
package goes through
Archive, which reads the directory only once. - safe_
relative - An entry name as a relative
/-separated path that cannot leave the target, orNonefor a name that tries: any..segment, a leading separator, a:(a drive or an alternate data stream), a NUL, or nothing at all. Names Windows would quietly rewrite go too: a trailing dot or space, and a reserved device name such asaux.ini.