From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,a3fbbb32c0836a50,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1995-01-13 03:51:16 PST Newsgroups: comp.unix.osf.osf1 Path: nntp.gmd.de!Germany.EU.net!wizard.pn.com!satisfied.elf.com!news.mathworks.com!news.alpha.net!uwm.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!nntp.crl.com!decwrl!pa.dec.com!src.dec.com!crl.dec.com!nntpd.lkg.dec.com!mrnews.mro.dec.com!janix.mfr.dec.com!okfest.unt.dec.com!hitchens From: hitchens@okfest.unt.dec.com (Francis J. Hitchens) Subject: fdopen differences between osf 1.3 and 3.0 Message-ID: <1995Jan13.115116.6928@janix.mfr.dec.com> Sender: news@janix.mfr.dec.com (SDSC USENET News System) Reply-To: hitchens@untvc2.enet.dec.com (Francis J. Hitchens) Organization: Digital Equipment G.m.b.H Date: Fri, 13 Jan 1995 11:51:16 GMT Hi, We have noticed the following difference between osf 1.3 and 3.0. Under osf 3.0 when file descriptor 1 is mapped to a stream using fdopen, exiting the program no longer causes the new stream buffer to be flushed when writing stdout to a file or a pipe. Under osf 1.3 the stream opened with fdopen is flushed under all circumstances. e.g for osf 3.0 $ prog < junk # produces output $ prog < junk | wc # produces no output $ prog < junk > /dev/tty # produces output $ prog < junk > junk2 # produces empty file The following small example illustrates the problem #include int main() { FILE *in, *out; int c; if((in = fdopen(0, "rb")) == NULL) perror("opening in"); if((out = fdopen(1, "wb")) ==NULL) perror("opening out"); while((c = getc(in)) != EOF) putc(c, out); /* fflush(out); Must call either of these under osf 3.0 to get output fclose(out); written to a file or a pipe. */ } Is this a bug or a feature ? regards Francis J. Hitchens