Line Buffered output

Peter da Silva peter at ficc.uu.net
Wed Oct 5 23:54:44 AEST 1988


In article <13866 at mimsy.UUCP>, chris at mimsy.UUCP (Chris Torek) writes:
> 	main() { putchar('g'); putchar('o'); putchar('\n'); for (;;); }

> 2BSD and 4BSD will both print `go\n' if stdout is a terminal, while
> under what I think you were proposing, you would never see anything.

I wouldn't expect to see anything in this program. I'm a good boy and
always fflush() when I know I'm going to be going away for a while.
Do you bother to fflush() before a fork()? Why not?

Oh well, I suppose you have good reasons for what you do. I just wish
you'd let me turn it off so I can really cook.

How does this all interact with curses, which generates newlines
essentially at random? Flushes at the newline and then an explicit
flush when update completes?
-- 
Peter da Silva  `-_-'  Ferranti International Controls Corporation.
"Have you hugged  U  your wolf today?"            peter at ficc.uu.net



More information about the Comp.unix.wizards mailing list