Skip to main content

Module path_utils

Module path_utils 

Source
Expand description

Path validation and utility functions

Functions§

create_validated_pathbuf
Creates a PathBuf from a string after validate_path_str.
is_just_filename
Checks if a path looks like a filename (no directory components)
is_symlink_dir
True when the path itself is a symlink (callers use it on symlinked dirs).
relative_path_from_dir
Compute a relative path from from_dir to to.
safe_parent_for_creation
Safely gets the parent directory for creating directories. Returns None for paths that don’t need directory creation (like “config.yaml” in current dir)
validate_path_segment
Validates that a string is safe to use as a single path segment (e.g. an id or file stem).
validate_path_str
Validates that a path string is non-empty and does not contain unsafe components.