Skip to main content

load_filex

Function load_filex 

Source
pub fn load_filex(
    state: &mut LuaState,
    filename: Option<&[u8]>,
    mode: Option<&[u8]>,
) -> Result<i32, LuaError>
Expand description

Load a file as a Lua chunk. Returns LUA_OK on success or an error code.

PORTING.md §1 bans std::fs outside lua-cli, so this goes through the embedder-installed file loader hook instead. A load failure pushes an error string and returns a non-zero status, which load_aux converts to (nil, errmsg).