Fclose
From SA-MP Wiki
Closes a file (stop reading/writing).
(File: handle)
| File:handle | The file handle to close. |
| Returns | true (1) on success false (0) on failure. |
| Important Note: The file handle must be valid, and must point to a file successfully opened by fopen. |
new File:example = fopen("Hello.txt", io_append); // Open 'Hello.txt' in the scriptfiles directory if(example == true) // Check that it was successfully opened { fwrite(example, "Hi there!"); // Write in the file fclose(example); // Close it }
[edit]
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- fopen: Open a file.
- fwrite: Write to a file.
- fread: Read a file.
- fremove: Remove a file.
