From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,da6010d18d851c86,start X-Google-Attributes: gidfee84,public From: bkm@bkmpc.bnsc.rl.ac.uk (Brian McIlwrath) Subject: Mixed FORTRAN and C I/O Date: 1998/08/17 Message-ID: <6r9a7q$1e5k@newton.cc.rl.ac.uk>#1/1 X-Deja-AN: 382048547 Organization: Rutherford Appleton Laboratory, Oxon, UK Newsgroups: comp.unix.osf.osf1 This a warning to anyone who, like us, might think that they wanted to mix f77 and C input on a stream (typically stdin). On Sun's and Linux systems this works just as expected BUT under Digital Unix the f77 RTL grabs a large chunk (all?) of the input file and provides no way to get at the contents of its internal buffer! So given a file Line 1 Line 2 Line 3 Line 4 etc. where the first line is read by something like a READ(*,'(A)') LINE in FORTRAN any attempt to read 'Line 2' etc. in a C routine encounters EOF instead. This might seem a rare occurence but in a LARGE system where some FORTRAN routines are slowly being replaced with C equivalents this can and does happen!