FileExists (check for file)
ts
function FileExists(what: string): boolean;Returns true if the file specified by what exists on the local file system, false otherwise.
| Parameter | Type | Requirement | Explanation |
|---|---|---|---|
what | string | required | Path to the file to check |
| Return value | Explanation |
|---|---|
true | The file exists |
false | The file does not exist, the path points to a directory, or the check failed |
Example
ts
if (FileExists('/var/data/report.csv')) {
Log('File is ready.');
} else {
Log('File not found, skipping.');
}