std.path
pure path string ops; reads / and , writes SEP; builders take an *Arena
pub SEP :: 92u8separator written by join and normalize
is_sep
Section titled “is_sep”pub is_sep :: fn(c: u8) -> booleither separator
basename
Section titled “basename”pub basename :: fn(p: []const u8) -> []const u8after the last separator; p if none, “” on a trailing separator
dirname
Section titled “dirname”pub dirname :: fn(p: []const u8) -> []const u8up to the last separator, trailing ones trimmed; “.” if none; a lone root stays
parent
Section titled “parent”pub parent :: fn(p: []const u8) -> []const u8alias of dirname
extension
Section titled “extension”pub extension :: fn(p: []const u8) -> []const u8includes the dot (“.txt”); “” if none; “.gitignore” has none
pub stem :: fn(p: []const u8) -> []const u8basename minus extension
is_absolute
Section titled “is_absolute”pub is_absolute :: fn(p: []const u8) -> boolleading separator, \ UNC prefix, or X: drive
is_relative
Section titled “is_relative”pub is_relative :: fn(p: []const u8) -> boolhas_extension
Section titled “has_extension”pub has_extension :: fn(p: []const u8, want: []const u8) -> boolleading dot in want optional
pub join :: fn(a: *Arena, x: []const u8, y: []const u8) -> []const u8one SEP between; extra separators collapsed; an absolute y wins
pub join3 :: fn(a: *Arena, x: []const u8, y: []const u8, z: []const u8) -> []const u8with_extension
Section titled “with_extension”pub with_extension :: fn(a: *Arena, p: []const u8, new_ext: []const u8) -> []const u8leading dot optional; “” removes the extension
normalize
Section titled “normalize”pub normalize :: fn(a: *Arena, p: []const u8) -> []const u8lexical clean-up: drops ., doubled seps and x/..; writes SEP; empty -> “.”
no disk access, so .. past a symlink is lexical; leading .. kept, root .. dropped