Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!udel!nigel.ee.udel.edu!mccalpin From: mccalpin@perelandra.cms.udel.edu (John D. McCalpin) Newsgroups: comp.sys.sgi Subject: Re: Binary files on 4D machines Message-ID: Date: 16 Aug 90 01:22:49 GMT References: <9008151931.AA04768@aero4.larc.nasa.gov> Sender: usenet@ee.udel.edu Organization: College of Marine Studies, U. Del. Lines: 26 Nntp-Posting-Host: perelandra.cms.udel.edu In-reply-to: blbates@AERO4.LARC.NASA.GOV's message of 15 Aug 90 19:31:14 GMT >>>>> On 15 Aug 90 19:31:14 GMT, blbates@AERO4.LARC.NASA.GOV ("Brent L. Bates AAD/TAB MS361 x42854") said: "Brent> Does anyone know if SGI plans on FIXING their FORTRAN, so that "Brent> we can write true binary files, the way we can on the 3000's. It ain't broke, so it don't need to be fixed.... The FORTRAN standard does not specify the inner details of a file opened with form=unformatted, so vendors are free to do what they wish. In this case, SGI (following MIPS, I suppose) decided to implement what is called a "control-word delimited" file in CDC-land. Each record in a sequential, unformatted file is preceded and followed by a 32-bit integer containing the number of bytes in the record. Three things to keep in mind: (1) This format is actually very convenient, since it is identical to the format used by Sun for sequential unformatted files. (2) You can get rid of the control words by writing a direct-access file instead of a sequential one. Of course, then the compiler expects the records to all be of the same length. (3) C is often faster for low-level binary I/O, and can be linked with the FORTRAN fairly easily. -- John D. McCalpin mccalpin@perelandra.cms.udel.edu Assistant Professor mccalpin@vax1.udel.edu College of Marine Studies, U. Del. J.MCCALPIN/OMNET