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

Home » Public Forums » archive » Re: Q: IDL and endianness issues
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: Q: IDL and endianness issues [message #19721 is a reply to message #19720] Tue, 11 April 2000 00:00 Go to previous messageGo to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Ossi Vaananen wrote:
>
> Hi!
>
> Let's say I have a binary file with known structure, and
> the file is written on a little-endian machine. Then I want
> to read it again on a big-endian machine. How do I do it?
>
> If endianness was no problem, I could do this simply by
> creating a structure with contents that match the alignment
> of the different data types in the binary file, and then
> read data to it from the file with READU.
>
> In Matlab, files can be opened with the endianness of the
> file explicitly given as an argument to fopen. In IDL manuals
> I saw no reference to such a feature in IDL.
>
> The question is, does there exist a built-in feature in IDL
> that somehow allows endianness-specified file I/O?

yes. You can use the swap_endian function or the swap_endian keyword to
the open command.

--
Paul van Delst Ph: (301) 763-8000 x7274
CIMSS @ NOAA/NCEP Fax: (301) 763-8545
Rm.202, 5200 Auth Rd. Email: pvandelst@ncep.noaa.gov
Camp Springs MD 20746
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: widget function returns an array
Next Topic: widget function returns an array

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

Current Time: Sat Nov 29 04:48:07 PST 2025

Total time taken to generate the page: 0.80583 seconds