file.load
File loader table aliases: load, loadfile, load_file, do, dofile and do_file.
Syntax
file.load(path: string) -> function
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | A path inside the Yuari workspace. |
Returns
| Type | Description |
|---|---|
function | The returned function. |
Description
file.load is part of the File system library. File APIs are limited to the Yuari workspace under %LOCALAPPDATA%\Yuari\workspace; absolute paths and traversal outside it are rejected.
Each call creates or returns a fresh object or value that you can store and pass to other functions.
The aliases file.loadfile(path), file.load_file(path), file.do(path), file.dofile(path), file.do_file(path) resolve to the same implementation.
Example
local chunk = file.load("script.lua")
if chunk then chunk() end
file.do("script.lua")
Notes
- Aliases:
file.loadfile(path),file.load_file(path),file.do(path),file.dofile(path),file.do_file(path). - All paths are confined to %LOCALAPPDATA%\Yuari\workspace.