Reference
Path
Basename
| Input | A file path string. |
|---|---|
| Output | The filename portion of the path. |
Signature
path_basename(a: String): StringExample
path_basename("/home/user/file.txt") // returns "file.txt"Dirname
| Input | A file path string. |
|---|---|
| Output | The directory portion of the path. |
Signature
path_dirname(a: String): StringExample
path_dirname("/home/user/file.txt") // returns "/home/user"Extension
| Input | A file path string. |
|---|---|
| Output | The file extension (including the dot). |
Signature
path_extension(a: String): StringExample
path_extension("/home/user/file.txt") // returns ".txt"Is Absolute
| Input | A file path string. |
|---|---|
| Output | True if the path is absolute, false otherwise. |
Signature
path_isAbsolute(a: String): BooleanExample
path_isAbsolute("/home/user") // returns trueJoin
| Input | Two path segments. |
|---|---|
| Output | The path segments joined together with the appropriate separator. |
Signature
path_join(a: String, b: String): StringExample
path_join("home/user", "file.txt") // returns "home/user/file.txt"Normalize
| Input | A file path string. |
|---|---|
| Output | The normalized path with redundant separators and segments removed. |
Signature
path_normalize(a: String): StringExample
path_normalize("/home//user/../user/file.txt") // returns "/home/user/file.txt"