Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!bbn.com!fwebb From: fwebb@bbn.com (Fred Webb) Newsgroups: comp.lang.fortran Subject: Re: File handling in Fortran 77 Message-ID: <59099@bbn.BBN.COM> Date: 23 Aug 90 12:53:11 GMT References: <11191@accuvax.nwu.edu> Sender: news@bbn.com Reply-To: fwebb@BBN.COM (Fred Webb) Organization: Bolt Beranek and Newman Inc., Cambridge MA Lines: 27 In article <11191@accuvax.nwu.edu> ravi@earth.ce.nwu.edu (Ravi Sinha) writes: >Hi, > >I have been wondering for a while about how certain aspects of >file handling are supposed to be in Fortran 77 standard. Maybe >someone can shed some light on it. > > (questions deleted to keep my mailer happy) According to the standard: i.,iii.: If a file is opened for sequential access, and a record is written to the file, that record "becomes the last record of the file" (ANSI X3.9-1978, 12.9.4.1, 12.9.6). Records in files opened for direct access can be written or rewritten without affecting any other records in the same file (ANSI X3.9, 12.2.4.2). ii.: If OLD is specified, the file must exist. If NEW is specified, the file must not exist. (ANSI X3.9-1978, 12.10.1) iv.: Fortran doesn't know from binary or ASCII. Records and files are foramtted (ASCII) or unformatted (binary. None of these issues are connected in any way to the issue of formatted or unformatted files. If you want to change a record in a file without truncating the file you must use direct access (ACCESS=DIRECT). -- Fred