Fwrite
From SA-MP Wiki
Write in a file.
(File:handle, string[])
| handle | The file to write to |
| string | The string to write |
| Returns | This function doesn't return a specific value |
public OnGameModeInit() { new File:log = fopen("/ServerLog.txt", io_write); // Open the file if(log) { fwrite(log, "Server started.\r\n"); // Write to the file (\r\n is for a new line) fclose(log); // Close the file } return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- fread: Read a file.
- fopen: Open a file.
- fclose: Close a file.
- fremove: Remove a file.
