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

Home » Public Forums » archive » Re: IDL XDR Problem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: IDL XDR Problem [message #9442] Mon, 07 July 1997 00:00
Jack Saba is currently offline  Jack Saba
Messages: 30
Registered: January 1996
Member
Justin Baker wrote:
>
> Hi there,
>
> I've got a problem with IDL when reading XDR data generated by a C
> program.
> I can happily read in longs or floats, but IDL gives a strange error
> when I try and read in strings.
>
> i.e % READU: Error encountered reading from file. Unit: 1
>
> My program is very simple, for example
>
> ...
> max_recs = 1000
> rec = {i:0, l:0L, f:0.0, s:''}

1. When reading a binary record, you have to specify the number of bytes
in the string or IDL won't know how much to read. Here you tell IDL to
read 0 bytes into rec.s.

2. IDL will pad this structure to a multiple of 4 bytes, in this case to
12 bytes (if the first variable were 8 bytes long, the padding would be
to 8N or 16 bytes). Chances are that's not the length of your record. If
your record is not 4N bytes long, you won't be able to use a structure
to read the data.

--
Jack Saba <jsaba@magus.stx.com>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: rosette
Next Topic: *writers/seeking/publication

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

Current Time: Wed Oct 08 13:43:18 PDT 2025

Total time taken to generate the page: 0.00525 seconds