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 -8
View File
@@ -2,14 +2,18 @@
bool file_exists(String path)
:params
path : the path name to be checked
return value : true if the file exists
path : path to check, resolved against the unit's directory
return value : true if a regular file exists at `path`
:content
Reports whether a regular file exists. Use it to guard reads or to confirm a write or delete took effect. It is file-oriented and returns false for directories — use `file_stat()` and check `is_dir` to test for a directory.
:example
file_put_contents("/tmp/doc-exists.txt", "x");
print(file_exists("/tmp/doc-exists.txt") ? "exists" : "missing", " / ");
print(file_exists("/tmp/doc-not-here-xyz.txt") ? "exists" : "missing", "\n");
:see
>sys
:content
Checks whether the file or path specified by `path` exists.
:example
print("file_exists example\n");
file_stat
file_unlink