comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Endian-ness
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Endian-ness [message #29236] Fri, 08 February 2002 12:47 Go to previous message
Jonathan Joseph is currently offline  Jonathan Joseph
Messages: 69
Registered: September 1998
Member
Is there a system variable that gives the endian-ness of the current
hardware? I am reading a file which tells me the endian-ness of the
data, and I'd like to swap_endian if it is different from the current
hardware. In lieu of finding a system variable to compare to, I have
done this:

test_int = 1
byteorder,test_int,/ntohs
big_endian = test_int eq 1

"network" byte order is big-endian, so I convert a 1 to the host
byte-order and see if it's still a 1.

This way works fine, but it seems as thought I'm missing something.
Is there a better way? Using the byteorder routine to convert the data
is not an option (unless it's been improved for 5.5).

Thanks.

-Jonathan
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: IDL5.5 online help
Next Topic: Tessellate Question--fewest convex polys

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:52:56 PDT 2025

Total time taken to generate the page: 0.00390 seconds