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
Re: Endian-ness [message #29302 is a reply to message #29236] Mon, 11 February 2002 10:01 Go to previous messageGo to previous message
Robert Stockwell is currently offline  Robert Stockwell
Messages: 74
Registered: October 2001
Member
Jonathan Joseph wrote:

> Thank you David and Liam,
>
> Liam's result seems more aesthetically pleasing (no offense David).
> Unfortunately, I don't think I can use the swap_if_big_endian and
> swap_if_little_endian keywords to OPEN, because whether I swap or
> not depends on BOTH the hardware and the file. I have no a-priori
> knowledge of the endian-ness of the file until I've already
> opened it. Although, I guess I could open the file, figure out
> what it is, close it and then re-open it.



This is exactly what I do. I have a rule that all data I write
shall be little endian, but there still can be files that are
big endian. I have a small range of possible values, so I read the
data in little endian, check the range, and if it exceeds the
range, reread the data as bigendian.
That seems to be the only way to tell if a file was written
as big/little endian. Of course, one could put a header
on the file indicating how it was written, but if someone else
writes the data, you are out of luck.


Cheers,
bob
[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 16:51:47 PDT 2025

Total time taken to generate the page: 0.00402 seconds