file tail

Gives the last part of a path.

file tail NAME

Description

Gives the last part of NAME. A separator at the end does not count, so notes/ gives notes.

Arguments

ArgumentTypeDefaultDescription
NAMEpathrequiredThe path.

Returns

The last part.

Examples

% file tail notes/2026/a.json
a.json

% file tail notes/
notes

Errors

% file tail
wrong # args: should be "file tail 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

See also