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

Home » Public Forums » archive » Re: Determining machine 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
Re: Determining machine endian-ness [message #12136 is a reply to message #12129] Thu, 02 July 1998 00:00 Go to previous messageGo to previous message
Kelly Dean is currently offline  Kelly Dean
Messages: 92
Registered: March 1997
Member
I check a value in my data that is normally constant. If this value is too big, I
byte-swap.

With IDL 4.0+, !VERSION tells you if your operating system is UNIX or WIN32. I
would use this to determine if I need to byte-swap on some occassions. However,
some people that use my stuff still are using IDL 3.6 - so I stick with checking a
number in the data for most of the IDL code I share.

Kelly

Mark Rivers wrote:

> Is there a way to determine whether the machine on which IDL is executing is
> big endian or little endian? I am trying to read a data file which I know
> contains little-endian data. I need to byte swap this data if IDL is running
> on a big-endian machine, but not byte-swap if it is running on a little-endian
> machine.
>
> It would be nice there were a field in !VERSION which contained this
> information. Right now I am testing if !VERSION.ARCH eq 'x26', 'alpha', etc.
> There must be a better way.
>
> ____________________________________________________________
> Mark Rivers (773) 702-2279 (office)
> CARS (773) 702-9951 (secretary)
> Univ. of Chicago (773) 702-5454 (FAX)
> 5640 S. Ellis Ave. (708) 922-0499 (home)
> Chicago, IL 60637 rivers@cars.uchicago.edu (e-mail)
>
> or:
> Argonne National Laboratory (630) 252-0422 (office)
> Building 434A (630) 252-0405 (lab)
> 9700 South Cass Avenue (630) 252-1713 (beamline)
> Argonne, IL 60439 (630) 252-0443 (FAX)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Important object lesson
Next Topic: Re: Using ASSOC function

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

Current Time: Tue Dec 02 13:48:37 PST 2025

Total time taken to generate the page: 0.79973 seconds