Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Processes

uji.proc.spawn(argv, opts)

Starts the program named by the first item of the list argv, with the rest as its arguments. The result is a process, or nil and an error message. The process is killed when nothing refers to it any more.

OptionTypeMeaning
cwdstringThe directory to run in.
envtableExtra environment variables.
stdiostring"pipe", the default, to read and write the process, or "inherit" to give it the terminal.
MemberMeaning
proc.pidThe process id.
proc:line()The next line of output with "stdout" or "stderr", or nil once both streams end.
proc:lines()An iterator over the remaining lines and their streams.
proc:write(data)Writes data to the process’s input.
proc:close()Closes the process’s input.
proc:kill()Kills the process.
proc:wait()Waits for the process to exit and gives a table with code, signal and success.