Skip to content

Aviarita/filesystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Filesystem library

Table of Content

open_file
read_file
write_file
append_file
file:read
file:write
file:clear
file:close

open_file(filename, pathid, mode)

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.

file:read()

Returns the content of the file.

file:write(text)

text - text you want to write to the text
Writes the given text ot the file.

file:clear()

Clears the file.

file:close()

Closes the file.

Paths IDs

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.

Modes

[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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published