Path
Source: std/path.mw.
Path helpers for ‘/’-separated paths. Functions returning *u8 allocate a new string (release it with dealloc).
Functions
Section titled “Functions”path_is_absolute
Section titled “path_is_absolute”fn path_is_absolute(p: *u8) -> boolpath_join
Section titled “path_join”fn path_join(a: *u8, b: *u8) -> *u8Joins two paths with exactly one separator; an absolute b wins.
path_basename
Section titled “path_basename”fn path_basename(p: *u8) -> *u8Last component (“/a/b/” -> “b”, “/” -> “/”).
path_dirname
Section titled “path_dirname”fn path_dirname(p: *u8) -> *u8Everything but the last component (“/a/b” -> “/a”, “b” -> “.”, “/a” -> “/”).
path_extension
Section titled “path_extension”fn path_extension(p: *u8) -> *u8File extension including the dot, as a pointer into p (“a/b.tar.gz” -> “.gz”), or “” when the last component has none (a leading dot does not count).
path_normalize
Section titled “path_normalize”fn path_normalize(p: *u8) -> *u8Resolves “.”, “..” and repeated separators lexically.