Module fs

Module fs 

Source
Expand description

Reading and writing filesystem trees to/from disk.

This module provides functionality to read filesystem structures from disk into composefs tree representations and write them back, including handling of hardlinks, extended attributes, and repository integration.

Structsยง

FilesystemReader
Helper for reading filesystem trees from disk into composefs representation.

Constantsยง

CONTAINER_XATTR_ALLOWLIST
Default xattr allowlist for container filesystems.

Functionsยง

is_allowed_container_xattr
Returns true if the given xattr name is in CONTAINER_XATTR_ALLOWLIST.
read_container_root
Load a container root filesystem from the given path.
read_file
Read the contents of a file.
read_filesystem
Load a filesystem tree from the given path. A repository may be provided; if it is, then all files found in the filesystem are copied in.
read_filesystem_filtered
Load a filesystem tree from the given path, filtering xattrs with a predicate.
set_file_contents ๐Ÿ”’
Attempt to use O_TMPFILE + rename to atomically set file contents. Will fall back to a non-atomic write if the target doesnโ€™t support O_TMPFILE.
write_directory ๐Ÿ”’
write_directory_contents ๐Ÿ”’
write_leaf ๐Ÿ”’
write_to_path
Writes a directory tree from composefs representation to a filesystem path.