loadfile
Compiles a workspace file without executing it.
Returns nil and a reason when the file cannot be read or compiled. File input is limited to 64 MiB.
loadfile(path: string): (function?, string?)Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Path relative to the Acedia workspace. |
Example
writefile("example.lua", "return 42")
local callback, reason = loadfile("example.lua")
if callback then print(callback()) else warn(reason) endExample output
42Errors: Invalid argument types raise; read or syntax failures return nil and an error string.
Aliases: loadfileasync.
