|  |  | Pathnames

## Pathnames

Pathnames allow you to work with hierarchical, structured pathnames in a reasonably portable fashion.

`pathname-to-components` | `(pathname|<str> => <lst>)` | `M`

given a pathname, split it into a list of individual directories, etc. Three special values are returned as symbols:

- `root` -> This path starts in the root directory
- `up` -> Go up a directory
- `current` -> Remain in the current directory

Volume labels, drive letters, and other non-path information should be stored in a single tagged list at the head. Note that the hierarchical portion of this pathname (everything but the label) must be non-empty at all times.

`components-to-pathname` | `(components|<lst> => <str>)` | `M`
| reassemble components created by the above function. |
`label-components` | `(components|<lst> => <lst>)` | `M`
| get any leading directory label. |
`hierarchical-components` | `(components|<lst> => <lst>)` | `M`
| get rid of any leading directory label, etc. |
`components-last` | `(components|<lst> => <any>)` | `M`
| return the last item in a list of components. |
`components-basename` | `(components|<lst> => <lst>)` | `M`
| return all but the last item of a bunch of components. Do some magic to handle cases like `'foo.txt' => './'` If you call this function enough times, you are eventually guaranteed to get components list ending in root, up or current. Requires the last item to be a string. |
`components-parent-directory` | `(components|<lst> => <lst>)` | `M`
| calculate the parent directory of a pathname. |
`<pathname-error>` | `(<simple-error>)` | `C`

|  |  | Pathnames