Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!iuvax!copper!bomgard From: bomgard@copper.ucs.indiana.edu (Tim Bomgardner) Newsgroups: comp.lang.fortran Subject: Re: File handling in Fortran 77 Message-ID: <55875@iuvax.cs.indiana.edu> Date: 30 Aug 90 19:16:07 GMT References: <46016@masscomp.ccur.com> <1990Aug29.173235.9405@ux1.cso.uiuc.edu> Sender: news@iuvax.cs.indiana.edu Organization: Indiana University, Bloomington IN. Lines: 39 In article burley@world.std.com (James C Burley) writes: >In article <1990Aug29.173235.9405@ux1.cso.uiuc.edu> mcdonald@aries.scs.uiuc.edu (Doug McDonald) writes: > > This has always bothered me. A file is just a sequence of it, usually > organized as bytes - a text file must be in "bytes". > > So how, in standard Fortran, do you dothe exact analog of the most primitive > file operations - those expressed in C as flavors of get, put, and seek. > It HAS to be possible to do this, as C requires it. > > Doug MCDonald > >You don't. Standard Fortran is built on older and more baroque/primitive >file storage technology than C/UNIX. Fortran allows systems to implement >files as consisting of zero or more fixed-length records, in particular. >So while, in C, you can (or could if ANSI C and its libraries ran on such >a system) read and write to arbitrary bytes in the file, in Fortran you >can't do it without using system calls, tricks, or nonstandard usage. > Rubbish. The answer is right there in front of you. Set RECL=1, ACCESS='DIRECT' in the open statement. For those of you who don't believe me, I'll be happy to email you fortran implementations of get, put, and seek that use no tricks whatsoever. Tim Bomgardner (sorry about this:) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx