Re: tape I/O under Unix: eof always true? [message #619] |
Fri, 01 January 1993 19:29 |
ljg
Messages: 5 Registered: January 1993
|
Junior Member |
|
|
Fred Knight (knight@ll.mit.edu) wrote:
: Can anybody give me some help on IDL's handling of eof while reading
: tape under Unix? The following test fails. I mount a (test) tar tape
: and do the following:
: IDL> openr,lun,/get_lun,'/dev/rst0'
: IDL> print,eof(lun)
: 1 ; <==== Why? Shouldn't it be zero?
: IDL> point_lun,lun,100
: IDL> print,eof(lun)
: 1 ; <==== Same question.
: IDL> a=bytarr(2048)
: IDL> readu,lun,a
: IDL> print,eof(lun)
: 1 ; <==== Same question.
: Thanks for any help,
: Fred
: --
: =Fred Knight (knight@ll.mit.edu) (617) 981-2027
: C-483\\MIT Lincoln Laboratory\\244 Wood Street\\Lexington, MA 02173
Hmmm . . . Didn't my recent posting make it out? In it, I mentioned
that eof() doesn't work with tape files. However, using on_ioerror works:
openr,1,'/dev/nrst0'
!error = 0
on_ioerror, done
while (1) do begin
readu,1,buf
; . . . process data . . .
endwhile
done:
if !error then print, !err_string
The above will work to read a single file from a tape, however I still
have no answer as to how to read multiple files from a tape. So far,
the only way I can read a second file is to exit completely out of IDL,
reposition the tape with mt, restart IDL and rerun the application.
I guess I'll be giving RSI a call on Monday.
larry-granroth@uiowa.edu
|
|
|