A lua library to spawn programs
- High level functions for common cases
- Bindings to the full
posix_spawn
family of functions - Compatible with Lua 5.1, 5.2, 5.3 and LuaJIT
Currently only works on POSIXy systems, but the high level module should be portable to Windows; someone just needs to put the work in.
It's recommended to install lua-spawn by using luarocks. This will automatically install run-time lua dependencies for you.
$ luarocks install spawn
Spawning a new child program from a lua script is surprisingly hard.
Existing solutions:
os.execute
doesn't allow interaction with any file descriptorsio.popen
only allows interaction with one ofstdin
orstdout
fork
+exec
isn't portable to non-MMU or non-unix architectures
This project uses the posix_spawn
family of functions.