/path
Cross-platform lexical path manipulation: dirname-of, file-name, extension-of, stem-of, join, and normalize.
Functions & symbols#
basename-of#
Returns the trailing component of a path.
| Parameter | Type | Optional | Description |
|---|---|---|---|
path | String | required | Input filesystem path |
Any(path/basename-of "/home/user/doc.txt") -> "doc.txt"dirname-of#
Returns the parent directory portion of a path, or empty string if none.
| Parameter | Type | Optional | Description |
|---|---|---|---|
path | String | required | Input filesystem path |
Any(path/dirname-of "/home/user/doc.txt") -> "/home/user"extension-of#
Returns the full file extension (e.g. "tar.gz", "data.tan"), or empty string if none.
| Parameter | Type | Optional | Description |
|---|---|---|---|
path | String | required | Input filesystem path |
Any(path/extension-of "archive.tar.gz") -> "tar.gz"get-dirname#
Returns the parent directory of `path` (deprecated alias; prefer `path/dirname-of`).
| Parameter | Type | Optional | Description |
|---|---|---|---|
path | String | required | Input filesystem path |
Anyget-extension#
Returns the file extension without leading dot (deprecated alias; prefer `path/extension-of`).
| Parameter | Type | Optional | Description |
|---|---|---|---|
path | String | required | Input filesystem path |
Anyis-absolute?#
Returns true if the path is absolute.
| Parameter | Type | Optional | Description |
|---|---|---|---|
path | String | required | Input filesystem path |
Any(path/is-absolute? "/usr/bin") -> trueis-relative?#
Returns true if the path is relative.
| Parameter | Type | Optional | Description |
|---|---|---|---|
path | String | required | Input filesystem path |
Any(path/is-relative? "src/main.tan") -> truejoin#
Safely joins multiple path segments using platform-specific path separators.
| Parameter | Type | Optional | Description |
|---|---|---|---|
parts | String | required | Variadic path segments |
Any(path/join "src" "bin" "main.tan")normalize#
Lexically normalizes path by resolving "." and ".." segments without accessing the filesystem.
| Parameter | Type | Optional | Description |
|---|---|---|---|
path | String | required | Input filesystem path |
Any(path/normalize "a/b/../c") -> "a/c"path-join#
Joins filesystem path segments cleanly (alias of `path/join`).
| Parameter | Type | Optional | Description |
|---|---|---|---|
parts | String | required | Path segments to join |
Any(path/path-join "app" "routes.tan")relative-to#
Computes the relative path required to navigate from base to target.
| Parameter | Type | Optional | Description |
|---|---|---|---|
base | String | required | Base reference path |
target | String | required | Target destination path |
Any(path/relative-to "/a/b" "/a/b/c/d") -> "c/d"resolve#
Resolves a sequence of paths into an absolute normalized path relative to the current working directory.
| Parameter | Type | Optional | Description |
|---|---|---|---|
paths | String | required | Path segments to resolve |
Any(path/resolve "config" "app.json")split#
Splits a path into an Array of its constituent component strings.
| Parameter | Type | Optional | Description |
|---|---|---|---|
path | String | required | Input filesystem path |
Any(path/split "a/b/c") -> ["a" "b" "c"]stem-of#
Returns the file stem (basename minus full extension). Preserves: stem-of + "." + extension-of == basename-of.
| Parameter | Type | Optional | Description |
|---|---|---|---|
path | String | required | Input filesystem path |
Any(path/stem-of "archive.tar.gz") -> "archive"