FileExists()
Determines whether a file exists
FileExists( source=any, allowRealPath=object );
Returns: Boolean
| Argument | Description |
|---|---|
|
source
any,
required
|
edit
a file path or URI. |
|
allowRealPath
object,
optional
|
edit
boolean that defines if relative paths are interpreted or not |
Examples
editvar filePath = "path/to/my/file.md";
if(fileExists(filePath)) echo "it exists"
See also
- Decision logic
- File handling
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)