file readable
Tests whether a file can be read.
file readable NAME
Description
Gives 1 when NAME exists and its permissions let a process read it, else 0.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| NAME | path | required | The path. |
Returns
1 or 0.
Examples
% set f [open n.txt w]; close $f
> file readable n.txt
1
% file readable nope.txt
0
Errors
% file readable
wrong # args: should be "file readable 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