
Function: File_Exists
Check if a file with given path exists in the file-system. To avoid errors one can check if a file exists before trying to open it, to example.
Prototype:
bool z = file_exists ( "/path/to/file.txt");
Parameters:
Parameter name | Type | Description |
---|---|---|
path | string | full path or relative path to the acutal file |
Return value: Type Boolean : True if file exists, otherwise false.
Example:
if ( file_exists ( "datafile.txt")) then
// read the datafile
else
// Create the datafile
end if
See also:
- Directory exists
- open
- close