file isfile

Tests whether a path is a file.

file isfile NAME

Description

Gives 1 when NAME is a regular file, else 0, also when NAME does not exist.

Arguments

ArgumentTypeDefaultDescription
NAMEpathrequiredThe path.

Returns

1 or 0.

Examples

% set f [open n.txt w]; close $f
> file isfile n.txt
1

% file mkdir data
> file isfile data
0

Errors

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