# Module /path

Cross-platform lexical path manipulation: dirname-of, file-name, extension-of, stem-of, join, and normalize.

```tangu
(use /path)
```

## Functions & symbols

### basename-of

`(path/basename-of path) -> String`

Returns the trailing component of a path.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `path` | `String` | no | Input filesystem path |

```tangu
(path/basename-of "/home/user/doc.txt") -> "doc.txt"
```

### dirname-of

`(path/dirname-of path) -> String`

Returns the parent directory portion of a path, or empty string if none.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `path` | `String` | no | Input filesystem path |

```tangu
(path/dirname-of "/home/user/doc.txt") -> "/home/user"
```

### extension-of

`(path/extension-of path) -> String`

Returns the full file extension (e.g. "tar.gz", "data.tan"), or empty string if none.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `path` | `String` | no | Input filesystem path |

```tangu
(path/extension-of "archive.tar.gz") -> "tar.gz"
```

### get-dirname

`(path/get-dirname path) -> (Or String None)`

Returns the parent directory of `path` (deprecated alias; prefer `path/dirname-of`).

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `path` | `String` | no | Input filesystem path |

### get-extension

`(path/get-extension path) -> (Or String None)`

Returns the file extension without leading dot (deprecated alias; prefer `path/extension-of`).

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `path` | `String` | no | Input filesystem path |

### is-absolute?

`(path/is-absolute? path) -> Bool`

Returns true if the path is absolute.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `path` | `String` | no | Input filesystem path |

```tangu
(path/is-absolute? "/usr/bin") -> true
```

### is-relative?

`(path/is-relative? path) -> Bool`

Returns true if the path is relative.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `path` | `String` | no | Input filesystem path |

```tangu
(path/is-relative? "src/main.tan") -> true
```

### join

`(path/join ...parts) -> String`

Safely joins multiple path segments using platform-specific path separators.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `parts` | `String` | no | Variadic path segments |

```tangu
(path/join "src" "bin" "main.tan")
```

### normalize

`(path/normalize path) -> String`

Lexically normalizes path by resolving "." and ".." segments without accessing the filesystem.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `path` | `String` | no | Input filesystem path |

```tangu
(path/normalize "a/b/../c") -> "a/c"
```

### path-join

`(path/path-join ...parts) -> String`

Joins filesystem path segments cleanly (alias of `path/join`).

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `parts` | `String` | no | Path segments to join |

```tangu
(path/path-join "app" "routes.tan")
```

### relative-to

`(path/relative-to base target) -> String`

Computes the relative path required to navigate from base to target.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `base` | `String` | no | Base reference path |
| `target` | `String` | no | Target destination path |

```tangu
(path/relative-to "/a/b" "/a/b/c/d") -> "c/d"
```

### resolve

`(path/resolve ...paths) -> String`

Resolves a sequence of paths into an absolute normalized path relative to the current working directory.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `paths` | `String` | no | Path segments to resolve |

```tangu
(path/resolve "config" "app.json")
```

### split

`(path/split path) -> Array`

Splits a path into an Array of its constituent component strings.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `path` | `String` | no | Input filesystem path |

```tangu
(path/split "a/b/c") -> ["a" "b" "c"]
```

### stem-of

`(path/stem-of path) -> String`

Returns the file stem (basename minus full extension). Preserves: stem-of + "." + extension-of == basename-of.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `path` | `String` | no | Input filesystem path |

```tangu
(path/stem-of "archive.tar.gz") -> "archive"
```
