Table of Content
open_file
read_file
write_file
append_file
file:read
file:write
file:clear
file:close
filename - name of the file you want to open
path id - pathid of the path where the file will be created/opened in/from
Returns a table with the following functions.
read_file(filename, pathid)
filename - name of the file you want to open
path id - pathid of the path where the file will be created/opened in/from
Returns the content of the file.
write_file(filename, pathid, text)
filename - name of the file you want to open
path id - pathid of the path where the file will be created/opened in/from
text - text you want to write to the text
Returns the size of the file.
append_file(filename, pathid, text)
filename - name of the file you want to open
path id - pathid of the path where the file will be created/opened in/from
text - text you want to write to the text
Returns the size of the file.
Returns the content of the file.
text - text you want to write to the text
Writes the given text ot the file.
Clears the file.
Closes the file.
MOD
The first SearchPath only.
GAME
All SearchPaths, including those inside GCFs.
GAMEBIN
The game binaries folder (client, server).
EXECUTABLE_PATH
The engine binaries folder.
DEFAULT_WRITE_PATH
Wherever the game is currently configured to write out to. Defaults to the first SearchPath.
[r] - Open for reading
[w] - Create for writing (will overwrite existing)
[a] - Append to
[r+] - Open for read/write
[w+] - Create for read/write
[a+] - Append to or create for read/write
[b] - When used with any of the above, flags file as binary