[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Non-blocking read from sub-process?
- From: Dan Christian <danchristian65@...>
- Date: Wed, 6 Apr 2016 09:42:18 -0700
Thank you. That was exactly what I needed!
I did re-write the first function to not depend on your stuff (in case
anyone else wants it).
#!/usr/bin/env lua
local posix = require('posix')
local data = string.rep("a",72) .. "\n"
for i = 1 , 5 do
local my_time = posix.time()
io.stdout:write(my_time .. data)
io.stdout:flush()
posix.sleep(1) -- delay 1 second
end
Thanks again,
Dan
On Tue, Apr 5, 2016 at 7:31 PM, Sean Conner <sean@conman.org> wrote:
> It was thus said that the Great Dan Christian once stated:
>> I want to run a sub-process that may or may-not generate output. How
>> can I make sure I don't block trying to read it. I'm happy to use
>> luaposix, but I'm trying not to use a big event framework like lua-ev
>> (because I'm memory limited and also don't want to cross compile it).