Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!nrl-cmf!cmcl2!brl-adm!adm!ultra!wayne@ames.arc.nasa.gov From: ultra!wayne@ames.arc.nasa.gov (Wayne Hathaway) Newsgroups: comp.unix.wizards Subject: Stdio buffering question Message-ID: <16124@brl-adm.ARPA> Date: 9 Jun 88 23:46:43 GMT Sender: news@brl-adm.ARPA Lines: 19 I hate to bother Wizards with what is probably a very simple question, but it stumps me. I have this very simple program that periodically does an fprintf(stderr,...) to indicate progress. The messages show up as written, as expected. Now I want to pipe this output through awk. This works fine, EXCEPT that all the lines are buffered in the originating process until it exits, then they all blast out at once. I realize I can put fflush()s in the original program, but isn't that against the "filters" philosophy? I mean, if it doesn't buffer when writing to the terminal, why does it buffer when writing to a pipe? I have done nothing special in the program about buffering, by the way, and the environment is SunOS 3.3. Thanx for any enlightenment! Wayne Hathaway ultra!wayne@Ames.ARPA Ultra Network Technologies 2140 Bering drive with a domain server: San Jose, CA 95131 wayne@Ultra.COM 408-922-0100