Greg Klanderman wrote:
Anyway the question is, if I redirect stdout and stderr as follows
(in /bin/sh):
% some_command > output.txt 2>&1
am I guaranteed that output to stdout and stderr by the program is
synchronized?
If some_command uses unbuffered I/O, then yes. The synchronisation
will be at the write() level, not at the (e.g.) fwrite() level.
Do the two output streams share the same buffer?
The data in output.txt will correspond to the order in which calls to
write() on either descriptors 1 or 2 occurred.
--
Glynn Clements <glynn(a)sensei.co.uk>