Skip to main content

io_popen

Function io_popen 

Source
pub fn io_popen(state: &mut LuaState) -> Result<usize, LuaError>
Expand description

io.popen(filename [, mode]). C: io_popen.

std::process::Command is banned in lua-stdlib; the child process is spawned via GlobalState::popen_hook, which lua-cli installs. When the hook is absent (sandboxed embeddings), this returns a clean Lua failure shape (nil, errmsg, errno) rather than panicking, so clients such as LuaRocks that probe io.popen fall back gracefully instead of crashing the host.