[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: cqueues/lua-http 'process controller' for Minecraft server in FreeBSD
- From: Daurnimator <quae@...>
- Date: Wed, 12 Sep 2018 14:02:55 -0700
On 12 September 2018 at 12:30, Russell Haley <russ.haley@gmail.com> wrote:
> What I don't know/understand yet if it's possible to run/control a process
> from Lua so that I can grab stdin/stdout?
Use https://github.com/daurnimator/lua-spawn to start programs
See https://github.com/daurnimator/lua-spawn/blob/master/examples/pipes.lua
for an example of controlling stdin/stdout of a child.
> I am hoping there is something in
> cqueues to do this, but once again thought I'd send out a general request
> for ideas.
You should be able to use cqueues.socket.dup or cqueues.socket.fdopen
to use normal cqueues socket functions with most types of file
descriptors.