cleanup, docs

This commit is contained in:
root
2026-06-16 23:02:45 +00:00
parent ea08d5f28b
commit b8b56cf3dd
160 changed files with 1076 additions and 511 deletions
+12 -10
View File
@@ -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