cleanup, docs
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user