Re: READU on IRIX and Win95, Big Endian, Little Endian [message #16342] |
Tue, 20 July 1999 00:00 |
Paul O Storaasli
Messages: 2 Registered: July 1999
|
Junior Member |
|
|
Well, Paul, SGI's along with most Unix Computers are Big endian, while
PCs are little endian. To tell
what type your computer is, you can use the following few lines, taken
from David Fanning's commentary on this subject
(http://www.dfanning.com/tips/endian_machines.html):
little_endian = (BYTE(1, 0, 1))[0]
IF (little_endian) THEN $
Print, "I'm little endian." ELSE $
Print, "I'm big endian."
If you want to read data from a Big Endian machine, on a little endian
machine, you might want to place the following
line in your code after you have read the data:
IF ((BYTE(1, 0, 1))[0]) THEN variablename= SWAP_ENDIAN(variablename)
Paul Storaasli
Raytheon Systems Company
postoraasli@west.raytheon.com
Paul O Storaasli wrote:
> When I use READU on the same file in Win95 and IRIX, I get different
> results.
> Is this possible? How would I read the file on a Win95 system?
> I am trying to read a binary file of 32-bit floats with the following
> code:
>
|
|
|