if-file-exists ( ..a path true: ( ..a path -- ..b ) false: ( ..a path -- ..b ) -- ..b ) (original) (raw)
Inputs
path | a pathname string |
---|---|
true | a quotation with stack effect ( ..a path -- ..b ) |
false | a quotation with stack effect ( ..a path -- ..b ) |
Outputs
None
Word description
If path is a file that exists, calls the true quotation, otherwise calls the false quotation.
Notes
It is possible for the file to be created or deleted after the call to file-exists? but before running true or false. If that is a concern, you might want to open the file for reading or writing, as needed.
See also
when-file-exists, unless-file-exists
Definition