Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.fortran Subject: Re: Position in file after open? Message-ID: <50500152@uxe.cso.uiuc.edu> Date: 15 Oct 89 15:34:00 GMT References: <1162@atha.AthabascaU.CA> Lines: 38 Nf-ID: #R:atha.AthabascaU.CA:1162:uxe.cso.uiuc.edu:50500152:000:1264 Nf-From: uxe.cso.uiuc.edu!mcdonald Oct 15 10:34:00 1989 /* Written 2:19 pm Oct 14, 1989 by lyndon@cs.AthabascaU.CA in uxe.cso.uiuc.edu:comp.lang.fortran */ /* ---------- "Position in file after open?" ---------- */ Can someone enlighten me as to what the ANSI F77 spec has to say about where a file pointer sits immediately after an open? We have looked at the documentation for a number of f77 compilers -- each one seems to have it's own idea of where to position the pointer. Assuming the following code fragment, what does the ANSI standard say about positioning the file pointer? (tmedata is an existing file with data in it.) program main . . open(unit = 10, file = 'tmedata') . . . /* End of text from uxe.cso.uiuc.edu:comp.lang.fortran */ Okay, what about this: 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? IF not legal, is there any legal way to overwrite a file besides attempting to open it for read, and if there closing it with a delete specifier, themn opening a new file for write? That appears to be the only way to do it in an oddball Fortran compiler I have (MicroWay NDPC for the 386). Doug McDonald