You might be looking for the File class, which has the same name as this library.
The file library provides functions for finding, reading and writing to files.
The following path values are most commonly used:
LUA searches the lua files (in /lua/, in your gamemodes, in all the addons).
GAME searches all the mounted content (main folder, addons, mounted games etc).
MOD searches only the garrysmod folder.
DATA searches in the data folder.
See File Search Paths for the descriptive list of path values.
For the full list of path values, type
path in the console.
Creates a directory that is relative to the data folder.
Deletes a file or empty folder that is relative to the data folder.
You can't remove any files outside of data folder.
path = "DATA" )
Returns the content of a file.
Beware of casing -- some filesystems are case-sensitive. SRCDS on Linux seems to force file/directory creation to lowercase, but will not modify read operations.
Attempts to rename a file with the given name to another given name.
This function is constrained to the data/ folder.
Returns the file's size in bytes. If the file is not found, returns -1.
Returns when the file or folder was lasted modified in Unix time.
Writes the given string to a file. Erases all previous data in the file. To add data without deleting previous data, use file.Append.