file type
Gives the kind of an entry of the file system: file, directory, link, and others.
file type NAME
Description
Gives file, directory, link, characterSpecial, blockSpecial, fifo, or socket for NAME. A missing file is an error.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| NAME | path | required | The path. |
Returns
The kind of the entry.
Examples
% set f [open n.txt w]; close $f
> file type n.txt
file
% file mkdir data
> file type data
directory
Errors
% file type nope.txt
could not read "nope.txt": no such file or directory
-errorcode POSIX ENOENT {no such file or directory}
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