Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!brutus.cs.uiuc.edu!apple!bloom-beacon!spdcc!ima!esegue!johnl From: johnl@esegue.segue.boston.ma.us (John R. Levine) Newsgroups: comp.lang.fortran Subject: Re: Position in file after open? Message-ID: <1989Oct16.143213.296@esegue.segue.boston.ma.us> Date: 16 Oct 89 14:32:13 GMT References: <1162@atha.AthabascaU.CA> <50500152@uxe.cso.uiuc.edu> Reply-To: johnl@esegue.segue.boston.ma.us (John R. Levine) Organization: Segue Software, Cambridge MA Lines: 18 In article <50500152@uxe.cso.uiuc.edu> mcdonald@uxe.cso.uiuc.edu writes: > OPEN(UNIT = 9,FILE = 'ALREADYEXISTS', STATUS = 'UNKNOWN') > REWIND(9) > >Is "unknown" a standard contruct or not? If so, should this always >begin writing at the begiining of file, overwriting anything alreay >there? Yes, UNKNOWN is actually in the standard, the other two options being NEW and OLD which say that the file must not or must exist. You cannot say in the OPEN statement whether your intention is to read or to write. REWIND positions a file at its initial point. (This is all from X3.9-1978, section 12.) It seems to me that this is as portable a way as any to open a file either for reading or for writing. -- John R. Levine, Segue Software, POB 349, Cambridge MA 02238, +1 617 864 9650 johnl@esegue.segue.boston.ma.us, {ima|lotus|spdcc}!esegue!johnl Massachusetts has over 100,000 unlicensed drivers. -The Globe