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
| Argument | Type | Default | Description |
|---|---|---|---|
| NAME | path | required | The 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
- Tcl 8.6.16 gives
absoluteforfile pathtype ~, since it expands~to the home folder (issue 684).
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