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



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.

HTH,

-Roy M


At 11:24 AM -0700 6/24/04, SeaSoft Systems wrote:
I am porting to OSX some legacy F77 code that was developed using the Absoft compiler on Mac OS 6 through OS 9.

As a first step, I have been playing with G77 and PB and am having reasonable success. I got a test application up and running but encountered the following odd circumstance:

The F77 code reads and writes raw binary data files as input and output. These are read and written as a stream of 4-byte integers (they are simply copies of a contiguous block of COMMON data).

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.

Obviously, this circumstance renders data file transport between the classic and OSX platforms very problematic.

The 4-byte chunk appears to be a pointer to the end of the data since its decimal representation is exactly one less than the data size, plus 4 extra bytes for the appended chunk, in bytes (i.e., the classic data file size is 5544 bytes, the OSX data file is 5544 +8 = 5552 bytes, and the value of both (fore and aft) data-file-bracketing chunks is 0x[00][00][15][AB] = 5547 decimal.

Can anyone explain what this is all about and how I might get rid of those offending extra bytes without OSX-specific code modifications? A compiler flag of some sort perhaps (I couldn't find anything that looked remotely applicable in man G77)?

Thanks for any guidance,

Richard Hartman
_______________________________________________
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.


--
Roy Mendelssohn
Pacific Fisheries Environmental Laboratory
1352 Lighthouse Avenue
Pacific Grove, CA 93950-2097

e-mail: email@hidden
voice: (831)-648-9029
fax: (831)-648-8440
www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
_______________________________________________
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.


References: 
 >Extra bytes in OSX vs classic binaries (From: SeaSoft Systems <email@hidden>)



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.