file atime
Gives the time of the last read of a file, in seconds.
file atime NAME
Description
Gives the time of the last access to NAME, in seconds since 1970-01-01 UTC. A missing file is an error. A new time as a second argument is an error in ztcl.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| NAME | path | required | The path. |
Returns
An integer of seconds.
Examples
% set f [open n.txt w]; close $f
> expr {[file atime n.txt] > 0}
1
Errors
% file atime nope.txt
could not read "nope.txt": no such file or directory
-errorcode POSIX ENOENT {no such file or directory}
% file atime n.txt 1700000000
file atime with a new time is not available
-errorcode NONE
Differences from Tcl
- Tcl 8.6.16 and 9.0.4 set the time with
file atime NAME TIME(issue 687).
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