Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!pacbell!att!ihnp4!upba!eecae!super.upenn.edu!linc.cis.upenn.edu!david From: david@linc.cis.upenn.edu (David Feldman) Newsgroups: comp.unix.wizards Subject: Re: Stdio buffering question Summary: It's a feature Message-ID: <4999@super.upenn.edu> Date: 10 Jun 88 16:37:13 GMT References: <16124@brl-adm.ARPA> Sender: news@super.upenn.edu Reply-To: david@linc.cis.upenn.edu.UUCP (David Feldman) Distribution: na Organization: University of Pennsylvania Lines: 14 A self proclaimed novice asked why stderr gets buffered when piped in Sun 0S 3.3. Well, I can give an answer based on Ultrix experience. When piping, stderr gets buffered so that it may be separated from stdout. Stdout goes through the pipe, and when it is closed, the stderr buffer gets flushed through the pipe. That is assuming you have redirected stderr through the pipe also. This is a documented feature, and I believe it is a csh thing. I can't remember off hand. I don't think fflush() will help, especially if it is done in csh. One way csh could implement this feature is to attach stderr to a file and then throw the file down the pipe when stdout closes. Any csh hackers know the details on this thing? I am guessin'. Dave Feldman david@linc.cis.upenn.edu