Std.Path
fn join(a: String, b: String) -> Stringb under a, with one / between them. If b is absolute (starts with /), it is b
itself. An empty side gives the other side.
parent
Section titled “parent”fn parent(path: String) -> Option[String]The path without its last component: parent("a/b.txt") is Some("a"), parent("/a") is
Some("/"). None for a single component ("a.txt"), the root "/", and "".
file_name
Section titled “file_name”fn file_name(path: String) -> Option[String]The last component: file_name("a/b.txt") is Some("b.txt"). None for the root "/",
"", and a path ending in . or ...
extension
Section titled “extension”fn extension(path: String) -> Option[String]The part of the file name after its last ., without the .: extension("a/b.tar.gz") is
Some("gz"). None if the file name has no ., only a leading one (".bashrc"), or ends
in . ("b.").