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

Home » Public Forums » archive » Re: Fortran unformatted data: Big or little endian
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: Fortran unformatted data: Big or little endian [message #35015 is a reply to message #34955] Mon, 05 May 2003 02:35 Go to previous messageGo to previous message
Michael Schroeter is currently offline  Michael Schroeter
Messages: 5
Registered: January 2002
Junior Member
David Fanning wrote:
>
>> and it works (up to now ;-)).
>
>
> I suspect it works *most* of the time. I don't see anything
> in there to *cause* the error. :-)
>

On my machines (IDL5.6, Red Hat Linux and hpux10.20) "readu" returns an
error ("Corrupted f77 unformatted file detected") if I swap to the wrong
endian-ness at the opening procedure.

>
> You can certainly read data any way you like. It's not
> until you try to make *sense* of the data that you are
> likely to run into trouble. In your case, you might try
> reading a known data value from the file. It that value
> is total nonsense (your were expecting 45 and you get
> -20435), then you could "throw" an error, rewind the file,
> and read the data again with the SWAP_ENDIAN keyword set.
>

Possibly, checking the data against sense/nonsense or reading a "magic"
number as suggested by Paul van Delst will be a better (maybe more
machine-independent?) solution.

Thanks, Michael

--
------------------------------------------------------------ ----------
Institute of Meteorology und Climatology
University of Hannover/Germany
Herrenhaeuser Str. 2, 30419 Hannover http://www.muk.uni-hannover.de
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Fortran unformatted data: Big or little endian
Next Topic: Re: WIDGET_TEXT - HOW TO NOT CHANGE VALUE OF TEXT WHILE EDITING FIELD?

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

Current Time: Fri Oct 10 12:25:08 PDT 2025

Total time taken to generate the page: 0.63848 seconds