Fopen

From SA-MP Wiki

Jump to: navigation, search

Fopen


Open a file to write from or read to


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


ReturnsFile:Filehandle, is 0 if failed


Modes

io_read      Reads the file. The file must exist
io_write     Write in the file, or create a new one
io_readwrite Reads the file or creates a new one
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