[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: io.popen of unknown program succeeds
- From: steve donovan <steve.j.donovan@...>
- Date: Sat, 28 Dec 2013 11:11:14 +0200
On Sat, Dec 28, 2013 at 11:04 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> function popen(prog,mode)
> local cond,msg,code = io.popen(prog,mode):close()
> if code==127 then error("'"..prog.."' not found") end
> return io.popen(prog,mode)
> end
Which ends up running the same program twice, problem if a heavy
process or not idempotent.
I have to agree with Luiz, use luaposix. You can do all that lovely
fork and exec stuff, and signal away like it was 1976
steve d.