Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site gargoyle.UChicago.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!ihnp4!gargoyle!paul From: paul@gargoyle.UChicago.UUCP (Paul Schinder) Newsgroups: net.lang.f77 Subject: Re: binary i/o problem Message-ID: <455@gargoyle.UChicago.UUCP> Date: Sat, 11-May-85 02:16:18 EDT Article-I.D.: gargoyle.455 Posted: Sat May 11 02:16:18 1985 Date-Received: Sun, 12-May-85 04:56:16 EDT References: <136@lamont.UUCP> <> Reply-To: paul@gargoyle.UUCP ( Schinder) Organization: U. Chicago - Computer Science Lines: 28 Summary: In article <> therneau@ur-msbvax.UUCP writes: > > You forgot to rewind the file (I think). The BSD fortran always opens >files at the end - assuming that you want to append to them. Hence the >immediate end-of-file > > > Terry Therneau > Statistics Dept. U of Rochester That's true in 4.1 BSD, but not 4.2, where f77 opens files at the beginning. I *think* the problem in the original posting is caused by the fact that the open statement doesn't include a "file = ...". When there is no filename, the filename defaults to "fort.unitnumber", which explains the error message (fort.5 does not exist, hence is empty, so the first read gets EOF). I almost replied saying to "open(5, file='/dev/tty',form='unformatted',...)", but I don't think this will work if you use a pipe to enter the data. I think in all cases /dev/tty is connected to the terminal. Does anyone have any other ideas? -- Paul Schinder Astronomy and Astrophysics Center University of Chicago uucp: ..!ihnp4!oddjob!paul