pub fn parse_path(input: &str) -> PathInfoExpand description
Parse and canonicalize a user-provided path (which may be relative or non-canonical)
Returns a PathInfo struct containing:
- existing_canonical: The longest prefix that exists and can be canonicalized
- non_existing_suffix: Any remaining path components that don’t exist
- full_path: The complete reconstructed path
§Examples
ⓘ
// Existing file
let info = parse_path("/Users/foo/file.txt");
assert!(info.fully_exists());
// Non-existing output file
let info = parse_path("/Users/foo/output.txt");
// info.existing_canonical = /Users/foo (if it exists)
// info.non_existing_suffix = output.txt
// Relative path
let info = parse_path("../data/file.txt");
// Resolves relative to current directory