file executable
Tests whether a file has a permission to run.
file executable NAME
Description
Gives 1 when NAME exists and has a permission to run, else 0. A new file of open has none.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| NAME | path | required | The path. |
Returns
1 or 0.
Examples
% set f [open n.txt w]; close $f
> file executable n.txt
0
Errors
% file executable
wrong # args: should be "file executable 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