file pathtype

Gives the kind of a path: absolute, relative, or volumerelative.

file pathtype NAME

Description

Gives absolute for a path that starts with /, and relative for the others. A ~ has no meaning: ~ is relative. In host mode on Windows the answers differ from tclsh (issue 686).

Arguments

ArgumentTypeDefaultDescription
NAMEpathrequiredThe path.

Returns

absolute, relative, or volumerelative.

Examples

% file pathtype a/b
relative

% file pathtype /a
absolute

% file pathtype ~
relative

Errors

% file pathtype
wrong # args: should be "file pathtype name"
-errorcode TCL WRONGARGS

Differences from Tcl

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