Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site cubsvax.UUCP Path: utzoo!linus!decvax!harpo!floyd!cmcl2!rocky2!cubsvax!noel From: noel@cubsvax.UUCP Newsgroups: net.unix-wizards Subject: Re: stdio buffering considered harmful Message-ID: <74@cubsvax.UUCP> Date: Wed, 27-Jul-83 11:11:01 EDT Article-I.D.: cubsvax.74 Posted: Wed Jul 27 11:11:01 1983 Date-Received: Mon, 1-Aug-83 08:03:52 EDT References: <1630@hplabs.UUCP> Organization: Columbia Univ Biology, New York City Lines: 24 I have run into the stdout buffering headache several times, most painfully when piping from an interactive fortran program. (Who wants to hack a -u flag into a large f77 program? I reluctantly did the equivalent). My problem was when using "script" or "tee", that stdout wasn't flushed when the program did a read on stdin. Is there a more general problem? I suppose in some cases you might need LINE buffering even when it's a unidirectional communication path too (the pipe reader wants to read line by line (why??)). Considering just the "interactive" case.. why couldn't stdio be smart enough to check for stdout being a pipe, then flush it when stdin is read? This way you wouldn't pay the performance penalty of ALWAYS line buffering on pipes, but fix the (most common?) problem with the current scheme. What am I missing? Noel Kropf harpo!rocky2!cubsvax!noel 1002 Fairchild philabs!cmcl2!rocky2!cubsvax!noel Columbia University New York NY 10027 212-280-5517 -- Noel Kropf harpo!rocky2!cubsvax!noel 1002 Fairchild philabs!cmcl2!rocky2!cubsvax!noel Columbia University New York NY 10027 212-280-5517