monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] question regarding stdio and streams


From: Nathaniel J. Smith
Subject: Re: [Monotone-devel] question regarding stdio and streams
Date: Fri, 22 Dec 2006 16:25:40 -0800
User-agent: Mutt/1.2.5.1i

On Fri, Dec 22, 2006 at 08:47:32AM +0100, Thomas Keller wrote:
> Nathaniel J. Smith schrieb:
> > If you want to include the information into automate stdio's stdout
> > stream, you need to multiplex it in somehow, and I don't have any
> > particular opinion on what the best way would be to write such code.
> > I'm sort of surprised you even want it :-).
> 
> The reason why it could be useful is because it contains status 
> information of what is currently going on, i.e. for mtn automate 
> push/pull/sync, which would be (if not merged into stdout) just hidden 
> for a GUI. Those messages tell the user again to which server he 
> connects, if a key (or anonymous access) is used and finally if the 
> process itself was a success. Now if this is missing, this is not such a 
> bad thing, if the process wouldn't spend sometimes more time on these 
> steps (i.e. connecting to a server) while the user doesn't get any 
> feedback on the action. The command line GUI tell me what it does, over 
> automate I can't see what happens.

I'm afraid this is rather hypothetical for me to have anything useful
to say.  If you just want to be able to take arbitrary text from
monotone and dump it at the user, I suppose capturing stderr is not
too hard either... but probably you do want more than that, i.e.,
structured status information, which would require quite a different
solution... but this is all for the use of commands that don't even
exist, so who knows what they will actually need... dunno.

> Btw... a sidenode, could it be that clog is by default redirected to 
> cerr anyways? At least here on OSX if I do 2>/dev/null, the log messages 
> disappear, while they are still available if I redirect stdout to 
> /dev/null. Before looking at monotone's sources I didn't even know of a 
> clog output stream, but thought cout and cerr where the only (used) ones...

Yes, clog and cerr are identical, except that clog is an ordinary
ostream while cerr is magic.  (In particular, I think cerr is
unbuffered or something like that.)  Both point to fd number 2, also
known as "stderr".

-- Nathaniel




reply via email to

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