gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] tla & user interactivity


From: David Allouche
Subject: Re: [Gnu-arch-users] tla & user interactivity
Date: Wed, 24 Mar 2004 17:19:10 +0100
User-agent: Mutt/1.5.5.1+cvs20040105i

On Wed, Mar 24, 2004 at 09:37:31AM -0500, Aaron Bentley wrote:
> David Allouche wrote:
> 
> >Some additional protocol could be used to colorize stdout and stderr
> >differently while preserving synchronization. I am not sure what is the
> >best way to do it, but you could just pipe everything through the
> >colorizer stdin (for synchronization) and use one control char to toggle
> >a bit between stdout/stderr (for different colorization and demuxing).
> 
> I guess another option would be a colorizing wrapper that handled stderr
> and stdout as separate file descriptors.

That's precisely what you cannot do correctly with pipes without using
some synchronization protocol.

In the absence of out-of-band synchronization, you cannot pipe stdout
and stderr through different fds and have a guarantee that you will read
the data in the order of writes. Pipes are asynchronous by nature, there
is no way around this.

That's why I proposed muxing them through a single fd with extra control
chars to allow demuxing.

-- 
                                                            -- ddaa




reply via email to

[Prev in Thread] Current Thread [Next in Thread]