Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extra bytes in OSX vs classic binaries



Richard Harmann writes:
The binaries produced by the G77 version of code have an extra 4-byte
chunk of data prepended at the front, and an *identical* 4-byte chunk
appended to the end of each binary data file, so the data files
produced by the G77-OSX version are exactly 8 bytes larger than the
binaries produced by the Absoft code running under classic on the
same machine. Other than these 8 errant bytes, the data files are, by
actual inspection, identical.

Roy replied:
The information at the beginning and end of the block is "record
length" information. Assuming you are using Absoft version 8 or
later, compile your program with the -N3 option, and open the file as
sequential, unformatted. Then the two systems should be compatible.

I'm not sure what the -N3 flag is, but I think this would help in going the other way. As I read it, Richard is reading files without record length info from code compiled with g77. A file w/o record length info is easiest read (ie using fully standard code) by opening as direct access. Sequential access requires some indication in the file as to the record length. With direct access, you define the record length in the open statement, and it can be any chunk of data smaller than the input file itself.

I've answered this sort of question enough times I actually added it to my web page: <http://www.atmos.washington.edu/~salathe/osx_unix/endian.html>

--
Eric Salathe
Climate Impacts Group <email@hidden>
University of Washington <http://www.atmos.washington.edu/~salathe>
_______________________________________________
fortran-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/fortran-dev
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.