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

Home » Public Forums » archive » read a C written binary file with IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
read a C written binary file with IDL [message #79238] Thu, 09 February 2012 19:44 Go to previous message
Thibault Garel is currently offline  Thibault Garel
Messages: 55
Registered: October 2009
Member
Hi,

I am having a problem with reading a C written binary file with IDL.
It may come from differences of type definitions between C and IDL but
I could not really figure out from Google...

In C, it writes a structure containing the following variable types:

struct MyStruct
{
int a;
long long b;
int c;
float d;
};

Then, in IDL, I read this with:

MyStruct = {$
a : 0L, $
b : 0LL, $
c : 0L, $
d : 0.0 $
}

openr, 1, filename, /SWAP_IF_BIG_ENDIAN
readu, 1, MyStruct
close, 1


but this gives me wrong values.

Did I miss something about the type conversion??

If someone could please clarify this, it would really help!
Thanks !
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: type conversion in GPULIB
Next Topic: Matlab!

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

Current Time: Thu Oct 09 22:41:24 PDT 2025

Total time taken to generate the page: 0.24311 seconds