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

Home » Public Forums » archive » Re: Use IDL6.0 to read gcc3.4(Mingw32) written data
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: Use IDL6.0 to read gcc3.4(Mingw32) written data [message #55268 is a reply to message #55188] Wed, 08 August 2007 14:29 Go to previous messageGo to previous message
badjelly.witch is currently offline  badjelly.witch
Messages: 27
Registered: May 2006
Junior Member
I don't know if the following is the cause of your problem, but in the
following code snippet...

cmat = fltarr(8,4)
openr, lun, "cmat.dat",/GET_LUN,/swap_endian

readu, lun, ii
readu, lun, cmat
readu, lun, jj

print, "ii", ii
print, "cmat", cmat
print, "jj", jj

...I see no sign that you have created the variables ii and jj before
reading them. In this case the variables will be created as scalars of
type float, which will not do what you intend.

On another tack, I suggest you download and install Hedit (it's free)

http://www.yurisw.com/HEdit.htm

With this tool you can look at the contents of your binary file. It
has a handy display at the top: you move the cursor to any position
and it shows the value that the 1, 2, 4 or 8 bytes starting at that
position will have if interpreted as a binary, byte, short, long,
float or double scalar. It should help you work out why one of your
files is 2 bytes longer than you expected.

On yet another tack, I don't understand why you would have to open
your files with SWAP_ENDIAN if they are being written on the same
platform as they are being read.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Structure Containing Structure: question about parentheses
Next Topic: Re: byte offset in POINT_LUN

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

Current Time: Thu Oct 09 07:35:46 PDT 2025

Total time taken to generate the page: 1.93261 seconds