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

Home » Public Forums » archive » Re: Problems reading binary files - pointer at 4096 gives EOF
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: Problems reading binary files - pointer at 4096 gives EOF [message #19476 is a reply to message #19473] Wed, 22 March 2000 00:00 Go to previous messageGo to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
David Fanning <davidf@dfanning.com> wrote in message
news:MPG.1342aea03d2e7a00989aa3@news.frii.com...
> Oliver Smith (osmith@dera.gov.uk) writes:
>
>> I'm working on a program which loads data from a structured binary file.
>> Each
>> file contains many sets of different data types, each data field is
>> preceeded by a header(int) and fieldlength (long) before the data
itself.
>> In order to read the files, I use a WHILE NOT EOF(file) loop as there is
no
>> indication of the last field in the file. I've hit a major problem with
>> this, the EOF test reports end of file whenever the file pointer is at
4096.
>
> Yikes! And I find the same problem in IDL 5.1, IDL 5.2.1, and IDL 5.3.1.
> I even find it if I use FSTAT to report the file pointer position.
>
> Please let us know what you find out, Oliver.

A simple test case worked fine for me in IDL 5.3 / Windows98:

IDL Version 5.3 (Win32 x86). (c) 1999, Research Systems, Inc.

IDL> openw, 1, 'zzz.dat' & writeu, 1, bytarr(16384) & close, 1
IDL> openr, lun, 'zzz.dat', /get_lun
IDL> point_lun, lun, 4096L
IDL> print, eof(lun)
0
IDL> info = fstat(lun)
IDL> print, info.cur_ptr
4096

Am I missing something?

Cheers,
Liam.
PS: You might want to check out my binread and binwrite programs for reading
and writing binary data:
http://cimss.ssec.wisc.edu/~gumley/binarytools.html
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Corel Linux & IDL -- Possible?
Next Topic: Secret to resizing text widgets

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

Current Time: Fri Oct 10 04:04:34 PDT 2025

Total time taken to generate the page: 0.79699 seconds