Skip to main content

Module path

Module path 

Source
Expand description

Safe path helpers. Safe path helpers.

Enums§

SafePathError
Error returned when a relative path escapes its expected root.

Functions§

absolute
Return an absolute path without requiring the path to exist.
canonicalize
Canonicalize a path by resolving symlinks and normalizing components.
confine_existing_path
Canonicalize an existing path and reject it when it resolves outside root.
confine_path
Resolve path under root and reject escapes, allowing the final path to be missing.
parent_dir
Return the non-empty parent directory for path.
resolve_root_relative_to
Resolve root against a base directory when relative, then canonicalize it.
safe_join
Join a caller-owned root with a validated relative path.
validate_relative_path
Validate that path is safe to join under a caller-owned root directory.