Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!ucla-cs!ucla-ma!luna!pmontgom From: pmontgom@luna.math.ucla.edu (Peter Montgomery) Newsgroups: comp.lang.fortran Subject: Re: flush doesn't work with dec3100 f77 compiler Message-ID: <1991May30.015750.10693@math.ucla.edu> Date: 30 May 91 01:57:50 GMT References: <_Q1+34+@engin.umich.edu> <13203@uhccux.uhcc.Hawaii.Edu> <1991May28.174723.13979@milton.u.washington.edu> Sender: news@math.ucla.edu Organization: UCLA Mathematics Dept. Lines: 40 C Compile this program with f77 under ULTRIX V4.0. C Then try ``a.out | cat''. The program requires input; type a 0. C All outputs will appear on your screen at once, as the C program terminates. Try ``a.out | cat'' again, this time entering C a 1 for input. The outputs will appear more quickly. C Also, CarriageControl = 'fortran' has its price. C Every format statement should output a blank initially. C If we redirect output (i.e., a.out > xxx) and later look C at output with the vi editor, C then every line ends with an unwanted control M. C In a larger program which has other output files C (on which I use an OPEN statement but no C CarriageControl = 'fortran'), the latest line is always missing C after I do a flush. I have been unable to get a small test case. program test implicit none integer iflag, OUTFIL, i, j parameter (OUTFIL=6) read *, iflag if (iflag.ne.0) then open(OUTFIL, CarriageControl = 'Fortran') write(OUTFIL, '('' Using Fortran carriage controls '')') else write(OUTFIL, '('' No open statement used '')') end if do i = 1, 3 call flush(OUTFIL) call sleep(2) write(OUTFIL, '('' Line '', i3, '' of pass '', i3)') * (j, i, j = 1, 3) end do end -- Peter L. Montgomery pmontgom@MATH.UCLA.EDU Department of Mathematics, UCLA, Los Angeles, CA 90024-1555 If I spent as much time on my dissertation as I do reading news, I'd graduate.