[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: catching stderror & stdout
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 20 Jul 1999 01:32:59 -0300 (EST)
>From firstname.lastname@example.org Tue Jul 20 01:02:31 1999
>From: Pablo Saldo <email@example.com>
>How can I catch the outputs from stderror and stdout in Lua? I mean
>redirecting them to a variable or such a thing.
You might redefine 'write' to save all output into a variable.
foreachi(arg, function (i,v) OUT=OUT..v end
Not the fastest code in the world, but it works.
For a faster solution, you could store in OUT a table of strings.
Otherwise, I guess you'd have to change liolib.c.