pub fn popen(prog: string, mode: option<string>) -> option<file>Expand description
Starts a program and connects to it with a pipe.
§Parameters
prog: the command to run in a separate process.mode:"r"to read the program’s output (the default) or"w"to write to the program’s input.
§Return value
A file handle connected to the program, or nil plus an error
message. This function is system dependent and is not available on
all platforms.
§Examples
local p = assert(io.popen("ls -1"))
for name in p:lines() do
print(name)
end
p:close()