Module path

Module path 

Source
Expand description

Path Module (STD-004)

Thin wrappers around Rust’s std::path for Ruchy-friendly API.

§Examples

use ruchy::stdlib::path;

// Join paths
let full_path = path::join("/home/user", "documents")?;

// Get file name
let name = path::file_name("/home/user/file.txt")?;

// Get extension
let ext = path::extension("/home/user/file.txt")?;

Functions§

canonicalize
Canonicalize a path (resolve to absolute, real path)
components
Get path components as a vector
extension
Get the file extension
file_name
Get the file name from a path
file_stem
Get the file stem (name without extension)
is_absolute
Check if path is absolute
is_relative
Check if path is relative
join
Join two path components
join_many
Join multiple path components
normalize
Normalize a path (remove . and .. components)
parent
Get the parent directory of a path
with_extension
Replace the extension of a path
with_file_name
Replace the file name of a path