[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Joining stdout and stderr
- From: David Given <dg@...>
- Date: Tue, 20 Dec 2005 13:46:34 +0000
On Tuesday 20 December 2005 12:26, Eduardo Ochs wrote:
> Hi list - is there a way to join Lua's stdout and stderr? In all the
> (few) ways that I've tried they kept using separate buffers, so if a
> program sends a lot of output to stdout and aborts with an error I get
> the error messages in the "wrong place", like this:
This is an OS issue, not a Lua issue --- Lua just hands the data over to the
OS's stdout and stderr implementations.
You don't mention whether you're dealing with pure Lua code (in which case
'io.stderr = io.stdout' will cause all output to appear over stdout), or
whether you're mixing with native code. If the latter, then posix.close and
posix.dup2 will allow you to close the underlying stderr file descriptor and
clone stdout onto it.
--
+- David Given --McQ-+
| dg@cowlark.com | Quidquid latine dictum sit, altum viditur.
| (dg@tao-group.com) |
+- www.cowlark.com --+
Attachment:
pgp6CD0ospx2W.pgp
Description: PGP signature