Yuari
Documentation
Docs/File system

File system

All file functions are sandboxed to the executor workspace: %LOCALAPPDATA%\Yuari\workspace. Paths outside the workspace (absolute paths, .. escapes) are rejected.

Limits. Allowed extensions: .txt .lua .luau .json .cfg .dat .ini. Max file size: 8 MB. Max path length: 1024 characters.

Writes a file, creating parent folders automatically. Raises an error on an invalid path, extension or size.

writefile("configs/aim.json", '{"fov":15}')

Reads a whole file and returns its contents as a string.

print(readfile("configs/aim.json"))

Appends data to the end of a file.

appendfile("logs.txt", "loaded\n")

Creates a folder recursively inside the workspace.

makefolder("configs/aim")

Returns true when the path is a regular file.

print(isfile("configs/aim.json"))

Returns true when the path is a directory.

print(isfolder("configs"))

Lists folder entries as sorted workspace-relative paths.

for _, path in ipairs(listfiles("configs")) do
    print(path)
end

Deletes a file and returns whether it succeeded.

delfile("configs/aim.json")

Deletes a folder and everything inside it.

delfolder("configs")

Compiles a file into a function with the Luau compatibility pass. Returns nil, message on failure.

local fn = loadfile("script.lua")
if fn then fn() end

Compiles and runs a file, returning its results.

dofile("script.lua")