Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!BRL.MIL!jra From: jra@BRL.MIL ("John R. Anderson", VLD/ASB) Newsgroups: comp.sys.sgi Subject: Re: Reading fortran "unformatted" files from C on the 4D. Message-ID: <8910251818.aa09277@VAT.BRL.MIL> Date: 25 Oct 89 22:18:05 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 19 Martin Knoblauch writes: > for(iz=0;iz nitem = fread(&dummy,4,1,fp); > fread(&i1,sizeof(int),1,fp); > fread(&i2,sizeof(int),1,fp); > fread(&i3,sizeof(int),1,fp); > fread(&farr[0],sizeof(float),3,fp); > nitem = fread(&dummy,4,1,fp); > } Note that although this will work on an IRIS 4D, not all fortran compilers create "unforamtted" files with the record length repeated at the beginning and end of the record. I have seen some that only include the record length at the start of each record. So depending on this will create non-portable code. -John