Skip to main content

Module fs

Module fs 

Source
Expand description

Filesystem primitives the lifecycle services share.

Hashing, guarded destination checks, and parent-creating writes — the mechanics only. Which destinations exist and what to do about a refusal is the installer’s and upgrader’s business.

Enums§

DestinationRefusal
Why a destination cannot be touched.

Functions§

check_destination
Check that touching destination under target stays inside the target.
remove_within
Remove a repository-relative file under a target, refusing a path that leaves it.
sha256_file
Hash a file’s bytes.
write_atomic
Write a file through a sibling temporary file and a rename, creating its parent directories.
write_file
Write a file, creating its parent directories.
write_within
Write a repository-relative destination under a target, refusing a path that leaves it.