path join for path
Join a structured path or a list of path parts.
Signature
> path join {flags} ...rest
Parameters
...rest: Path to append to the input.
Input/output types:
| input | output |
|---|---|
| string | string |
| list<string> | string |
| record | string |
| table | list<string> |
Examples
Append a filename to a path
> '/home/viking' | path join spam.txt
/home/viking/spam.txtAppend a filename to a path
> '/home/viking' | path join spams this_spam.txt
/home/viking/spams/this_spam.txtUse relative paths, e.g. '..' will go up one directory
> '/home/viking' | path join .. folder
/home/viking/../folderUse absolute paths, e.g. '/' will bring you to the top level directory
> '/home/viking' | path join / folder
/folderJoin a list of parts into a path
> [ '/' 'home' 'viking' 'spam.txt' ] | path join
/home/viking/spam.txtJoin a structured path into a path
> { parent: '/home/viking', stem: 'spam', extension: 'txt' } | path join
/home/viking/spam.txtJoin a table of structured paths into a list of paths
> [[ parent stem extension ]; [ '/home/viking' 'spam' 'txt' ]] | path join
╭───┬───────────────────────╮
│ 0 │ /home/viking/spam.txt │
╰───┴───────────────────────╯Notes
Optionally, append an additional path to the result. It is designed to accept the output of 'path parse' and 'path split' subcommands.