Fexist
From SA-MP Wiki
Fexist
Checks if a specific file exists in your scriptfiles directory.
(name[])
| name[] | The file to search for |
| Returns | true if it exists and false if it doesn't exist. |
if(!fexist("myfile.txt") { print("Your file does not exist"); } else { new File:fhandle = fopen("myfile.txt",io_append); fwrite(fhandle,"mytext"); fclose(fhandle); }
Related Functions
The following functions might be useful as well, as they're related to this function in one way or another.
- fopen: Open a file.
- fclose: Close a file.
