DirExists (check for directory)
ts
function DirExists(what: string): boolean;Returns true if the directory specified by what exists on the local file system, false otherwise.
| Parameter | Type | Requirement | Explanation |
|---|---|---|---|
what | string | required | Path to the directory to check |
| Return value | Explanation |
|---|---|
true | The directory exists |
false | The directory does not exist, the path points to a file, or the check failed |
Example
ts
if (!DirExists('/var/data/output')) {
MakeDir('/var/data/output');
}