Skip to main content

dofile

Function dofile 

Source
pub fn dofile(filename: option<string>) -> Repeatable<any>
Expand description

Opens the named file and executes its contents as a Lua chunk. When called without arguments, executes the contents of the standard input. Returns all values returned by the chunk. In case of errors, dofile propagates the error to its caller: it does not run in protected mode.

§Examples

dofile("config.lua")     -- run config.lua in the current environment