Appearance
File
Reference for the file API.
WARNING
Paths are limited to the Lexis folder, trying to use a path in another directory will fail.
Functions
file.exists
If a file exists.
lua
---@param path string
function file.exists(path): boolfile.remove
Deletes a file.
lua
---@param path string
function file.remove(path): boolfile.open
Deletes a file.
lua
---@param path string
---@param options { append: bool, create_if_not_exists: bool }
function file.open(path, options): fileTypes
file
| Field | Type |
|---|---|
valid | bool |
text | string |
json | json |
Examples
lua
local handle = file.open(paths.cheat .. 'test.txt', { create_if_not_exists: true })
if handle.valid then
handle.text = 'this is test text'
end