C
Cell
when both are connected to screen and the anything written to these
two constant file pointers will go onto the screen ?
two constant file pointers will go onto the screen ?
when both are connected to screen and the anything written to these
two constant file pointers will go onto the screen ?
WANG said:On Tue, 11 Mar 2008 02:59:24 -0700?Nick Keighley wrote?
{snip}
I'd say stdout is default to be line-buffered and stderr is default to
be unbuffered. But, of course, your can use setvbuf to change this.
And yes, in Linux/Unix, you may want the errors go into a different
direction, e.g. /dev/null, then stdin and stderr differ.
Cell said:when both are connected to screen and the anything written to these
two constant file pointers will go onto the screen ?
they aren't constant. But yes if you point them both at the same place
then anything directed at either one will go to the same place. Wouldn't
you be surprised if the behaviour was different?
The point is they can be sent to different places. Eg. in Unix they can
be redirected in the shell. stdout is for output (eg. in a filter- think
of copying one stream to another) and stderr for errors. You might not
want errors to appear in your copied file. stdout is often (always?)
buffered for efficeint i/o whilst stderr is usually (always?) unbuffered
for immediate i/o. Presumably the assumption is your program will
produce more legitimate output than error messages
Maybe he works for Microsoft...Why would you want to lose all the error messages? They should go to a
log file or to syslog, not /dev/null, IMO.
Doug said:Maybe he works for Microsoft...
Why would you want to lose all the error messages? They should go to a
log file or to syslog, not /dev/null, IMO.
Maybe he works for Microsoft...
Maybe he works for Microsoft...
WANG Cong wrote:
Why would you want to lose all the error messages? They should go to a
log file or to syslog, not /dev/null, IMO.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.