File

⚠️ Warning
Paths are limited to the Lexis folder, trying to use a path in another directory will fail.

Functions

exists

If a file exists.

---@param path string
function file.exists(path): bool

remove

Deletes a file.

---@param path string
function file.remove(path): bool

remove

Deletes a file.

---@param path string
---@param options { append: bool, create_if_not_exists: bool }
function file.open(path, options): file

Types

file

TypeName
boolvalid
stringtext
jsonjson

Example

local handle = file.open(paths.cheat .. 'test.txt', { create_if_not_exists: true })
if handle.valid then
  handle.text = 'this is test text'
end