cleanup, docs
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
:sig
|
||||
time_t file_mtime(String file_name)
|
||||
u64 file_mtime(String file_name)
|
||||
|
||||
:params
|
||||
file_name : name of the file
|
||||
return value : Unix time stamp of the file's last modification
|
||||
file_name : path to inspect, resolved against the unit's directory
|
||||
return value : last-modified time as a Unix timestamp, or 0 if missing
|
||||
|
||||
:content
|
||||
Returns a file's last-modified time as a Unix timestamp. Compare two files' mtimes for cache-freshness checks, or test for `> 0` to confirm a file exists with a real timestamp.
|
||||
|
||||
:example
|
||||
file_put_contents("/tmp/doc-mtime.txt", "x");
|
||||
print(file_mtime("/tmp/doc-mtime.txt") > 0 ? "has a modification time" : "missing", "\n");
|
||||
|
||||
:see
|
||||
>sys
|
||||
>time
|
||||
|
||||
:content
|
||||
Retrieves the last modification date of `file_name` as a Unix timestamp.
|
||||
|
||||
:example
|
||||
print("file_mtime example\n");
|
||||
file_stat
|
||||
time
|
||||
|
||||
Reference in New Issue
Block a user