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

Home » Public Forums » archive » Re: reading unformatted data into a structure
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: reading unformatted data into a structure [message #29744 is a reply to message #29742] Tue, 19 March 2002 00:38 Go to previous messageGo to previous message
ignore_this_adress is currently offline  ignore_this_adress
Messages: 3
Registered: June 2001
Junior Member
Rick Towler wrote:

> I have an unformatted data file which I am trying to read and I am having
> only limited success. The data file was created on a Sun machine and it is
> being read on a win32 machine (I have set the swap_if_little_endian keyword
> on the open statement). As for the file format, all I have to go on is the
> C header file that describes the records in the file.

>
> Am I doing this correctly? I know I am close because I get what seems like
> a valid time and I know I get a valid datum. But my data doesn't seem
> right. I just want to check that I am using the correct types in my IDL
> struct and that I am reading in the data correctly.

Most compilers have switches to set memory alignment. This has of course to
match the way the IDL structure is aligned in memory for IDL to read in the
struct properly. Without other tools, I would try the following :
count the total number of allocated bytes in the header, and compare it to
the raw data filesize. If the sizes don't match, you'll know you have run
into
problems. Alternatively, you can count the number of elements in the IDL
struct :-) If the size match, you'll probably have the right data.

Using a hexeditor may be informative when looking at your raw data format.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Image editing with IDL?
Next Topic: days of the week

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

Current Time: Sat Oct 11 11:22:06 PDT 2025

Total time taken to generate the page: 1.19993 seconds