Re: Problem with reading 4-byte floats from file on Intel
Re: Problem with reading 4-byte floats from file on Intel
- Subject: Re: Problem with reading 4-byte floats from file on Intel
- From: email@hidden
- Date: Mon, 03 Dec 2007 14:02:43 -0500
Hi Doug,
Thanks, but as far as I can tell, the "read" is not even occurring on
the Intel Mac (nothing appears in the Event Log). So we don't even have
a chance for there to be a byte ordering problem yet :)
- Rick
On 12/3/2007 12:58 PM, Doug McNutt wrote:
At 12:09 -0500 12/3/07, email@hidden wrote:
I have an Applescript that reads a series of floats (4-byte) from a binary file. This script works fine on PPC, but doesn't read anything at all on my MacBook.
Here's a brief snippet. If I run this in Script Editor on my G5 Mac, and look at the Event Log window, I can see my data appear after the "read" line has been executed. On the Intel Mac, no data is printed to the event log. If I change "small real" to "real", I can see data in the Intel Mac's event log, but it is 8-byte float data.
I'm betting on a byte ordering problem.
ABCD in a 32 bit word goes to either BADC or DCBA depending on whether it's Microsoft or Sun Microsystems. Things can get even less well defined on 64 bit hardware.
You might be able to prove it with something like a dump in HEX of the first few floats on each machine.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden