MyChat Scripts Engine: FileExists, check if a file exists
Function to check if the file exists by the specific path.
Syntax
function FileExists(sFileName: string): boolean;
Parameters and return values
Parameter |
Type |
Value |
sFileName |
string |
file name and full path. |
Function result
True, if the file exists, false if such file not found.
Example
begin
if FileExists('c:\swapfile.sys') then mLogScript('Windows swap file is located on the drive C:', '')
else mLogScript('Windows swap file is not found on the drive C:', '');
end.
Script work result
[14:40:45] (Log "FileExists"): Windows swap file is located on the drive C:
[14:40:45] (Run "FileExists"): Script operation time: 5 ms
[14:40:45] (Run "FileExists"): Script done successfully.