[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File pointer problem on PC-IDL

landsman@stars.gsfc.nasa.gov (Wayne Landsman) wrote:
> 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.

Wayne, don't ask me why, but ask your remote user to include the switch
/NOAUTOMODE in the OPEN call.

Oh well, it's hard to turn down any opportunity to pick on RSI for this
little Windows feature of theirs.  :-)	It has bothered me since the day it
sidled onto the scene, announced - as it were - somewhere in the bowels of
the readme file.  Basically IDL's I/O on Windows has a "text mode" and a
"binary mode". One of these (the "binary" mode, would you believe?) fools
around with <CR><LF> pairs.  For some reason your EOF check is triggering IDL
to switch to "binary" mode or something.  (I haven't checked, but it seems
unlikely to me that your file would have enough <CR><LF> pairs to fool with
to account for the discrepancy - it looks more like a bug.)  Another strange
thing is that (in this case) if you use the /BINARY switch in the OPEN call
it will also fix the problem.  (I don't even want to speculate on this one.)

Peter Mason

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own