Expand description
Filesystem metadata helpers used by preflight/apply for Minimal Facts and gating.
This module provides conservative, non-mutating probes for:
kind_of(path)
: classify node kind (file/dir/symlink/missing/unknown)resolve_symlink_target(path)
: resolve symlink target to an absolute pathdetect_preservation_capabilities(path)
: detect which preservation dimensions are likely supported on the current platform and under current privileges.
Notes:
- Owner preservation is reported true only when the effective UID is 0 (root).
- xattrs support is probed via the
xattr
crate by attempting to list attributes. - Timestamps and mode are reported true when metadata is readable for the path.
- ACLs and capabilities are conservatively reported false.
Functionsยง
- detect_
preservation_ capabilities - Heuristic preservation capability detector for target path.
Returns (preservation map,
preservation_supported
flag). This is intentionally conservative and non-mutating; it checks basic platform support and permission surface for: - kind_of
- Return a string describing the kind of filesystem node at
path
. - resolve_
symlink_ target - If
target
is a symlink, resolve its target to an absolute path. Relative link targets are resolved relative to the parent directory oftarget
. - sha256_
hex_ of - Compute SHA-256 of a file at
path
, returning a lowercase hex string.