file split
Gives the parts of a path as a list.
file split NAME
Description
Gives the parts of NAME between the separators. An absolute path starts with the part /. Repeated separators and a separator at the end add no part. An empty NAME gives an empty list.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| NAME | path | required | The path. |
Returns
The list of the parts.
Examples
% file split notes/2026/a.json
notes 2026 a.json
% file split /a/b
/ a b
% file split a//b/
a b
Errors
% file split
wrong # args: should be "file split name"
-errorcode TCL WRONGARGS
Facts
- Capability
file. A new interpreter does not have it until the host turns it on.- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztcl 1.0.0-beta.1