Fopen

From SA-MP Wiki

Jump to: navigation, search

Fopen


Open a file (to read from or write to).


Parameters:
(name[], mode)
name[]The name of the file to open
modeThe mode to open the file with


ReturnsReturns the Filehandle. 0 if failed to open file


Modes

io_read      Reads from the file.
io_write     Write in the file, or create the file
io_readwrite Reads the file or creates it
io_append    Appends to file, write-only
new File:example = fopen("file.txt", io_write);
fwrite(example, "I just wrote here!");
fclose(example);

Related Functions

The following functions might be useful as well, as they're related to this function in one way or another.

Personal tools
In other languages