Mail Archives: cygwin/1999/02/25/21:58:06
"Pierre A. Humblet" <Pierre DOT Humblet AT eurecom DOT fr> writes:
> At 12:09 PM 2/25/99 -0800, E. Robert Tisdale wrote:
> Robert,
>
> As I said, at least on my machine, od -c shows all lines of test.out ending w
> ith \r \n. Now when I modify your program end remove the third setmode, which
> switches back to TEXT, then all lines appear in binary mode!
> Here is a possible explanation: your program is not flushing the buffer and t
> he "effective" mode is the last one, at the time data is moved to disk.
> stdout is flushed more often, that's why it works.
>
I believe Pierre has something here. I took another look at your code, and
you're changing the mode of a buffered stream! Could you flush the
stream (stream << flush) before changing the mode and see what happens?
I don't believe that your code is well-defined, since changing anything
for an underlying descriptor of a buffered stream without flushing is
not guaranteed to produce the desired effect.
Regards,
Mumit
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
- Raw text -