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, validating it’s not empty or whitespace
is_just_filename
Checks if a path looks like a filename (no directory components)
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 not empty or just whitespace