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

Home » Public Forums » archive » File pointer problem on PC-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
File pointer problem on PC-IDL [message #14602] Thu, 11 March 1999 00:00 Go to previous message
landsman is currently offline  landsman
Messages: 93
Registered: August 1991
Member
I am trying to debug a program (a "FITS" reader) that is failing on PC-IDL
Unfortunately, I don't have access to PC-IDL myself so I apologizing for not
doing as much debugging as I would have liked before posting my problem.

Basically, then internal file position is getting screwed up. I open a
binary file, readu 2880 bytes, and find myself located 4095 bytes into the
file. Below is the simple script (as done by a remote user with PC-IDL).

IDL> print, !version
{ x86 Win32 Windows 5.2 Oct 30 1998}

IDL> openr,lun,'C:\burst_image_1.fit',/block,error=error,/get_lun
IDL> if eof(lun) then message, 'Reached end of file'
IDL> buf = replicate(32b,80,36) ;Total of 2880 bytes
IDL> readu,lun,buf
IDL> help,/str,fstat(lun)
** Structure FSTAT, 12 tags, length=36:
UNIT LONG 100
NAME STRING 'C:\ROTSE\GRB 990123\burst_image_1.fit'
OPEN BYTE 1
ISATTY BYTE 0
ISAGUI BYTE 0
INTERACTIVE BYTE 0
READ BYTE 1
WRITE BYTE 0
TRANSFER_COUNT LONG 2880
CUR_PTR LONG 4095
SIZE LONG 25920
REC_LEN LONG 0


How did the current pointer get at 4095 bytes??? Calling EOF() is not
supposed to change the file position. The situation seems reminiscent of
a VMS mode where one always reads in multiple of 512 bytes. (To avoid this
problem is why the VMS-only /BLOCK keyword is added to the OPENR statement
above.) But I wasn't aware of such fixed block I/O on a PC.

Anyone have any ideas? (The file burst_image_1.fit is available at
ftp://idlastro.gsfc.nasa.gov/landsman/fits)

thanks, --Wayne Landsman landsman@mpb.gsfc.nasa.gov
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: test for ENVI running in IDL code
Next Topic: 9 dimensions arrays

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

Current Time: Fri Oct 10 04:38:35 PDT 2025

Total time taken to generate the page: 1.99918 seconds