Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!sdd.hp.com!decwrl!sgi!shinobu!odin!dinkum!calvin From: calvin@dinkum.wpd.sgi.com (Calvin H. Vu) Newsgroups: comp.sys.sgi Subject: Re: Binary files on 4D machines Message-ID: <1990Aug16.181147.14476@odin.corp.sgi.com> Date: 16 Aug 90 18:11:47 GMT References: <9008151931.AA04768@aero4.larc.nasa.gov> Sender: news@odin.corp.sgi.com (Net News) Organization: Silicon Graphics, Inc. Mountain View, CA Lines: 59 In <9008151931.AA04768@aero4.larc.nasa.gov> blbates@AERO4.LARC.NASA.GOV ("Brent L. Bates AAD/TAB MS361 x42854") writes: | Does anyone know if SGI plans on FIXING their FORTRAN, so that | we can write true binary files, the way we can on the 3000's. | This capability is SUPPOSE to be in release 3.3, however, it doesn't | work. I want to open a file with a command like: | | open(unit,file='filename',form='binary') | | Then write to the file: | | write(unit) data | | Writting to a binary file should be as easy as writing to a | sequential unformatted file, the ONLY thing I should have to | change is the 'form' parameter in the open statement. | -- In 3.3, there are two new ways to open a file: 1) open(unit,file='filename',form='binary') allows you you to read/write binary data using formatted I/O. E.g: I = 10 write (1, 10) i 10 format(a4) rewind(1) read(1, 10) j print *, i, j end It is not the same as FORM='BINARY' on the 3000 series, however. 2) open(unit, file='filename', access='direct', recl=1, form='unformatted') provides the same capability as opening file with FORM='BINARY' on the 3000 series. There will be no record marks and the file is treated as sequence of bytes to be consumed/written. To make this work the program has to be compiled with -old_rl option so that the record length is interpreted as the number of bytes (the default is number of words). You only need to change the OPEN statement of the 3000 series' Fortran to make it work in the same way on the 4D i.e. you only need to modify one line for each opened binary data file. READ/WRITE statements won't need to be changed. | | Brent There's also a write-up in the release notes for this. If you experience any incompatibility besides the cosmetic change in the way the file is opened please let us know. - calvin -- ----------------------------------------------------------------------------- Calvin H. Vu | "We are each of us angels with only one Silicon Graphics Computer Systems | wing. And we can only fly embracing calvin@sgi.com (415) 962-3679 | each other."