home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.idl-pvwave
- Path: sparky!uunet!wupost!crcnis1.unl.edu!moe.ksu.ksu.edu!hobbes.physics.uiowa.edu!ljg
- From: ljg@space.physics.uiowa.edu (Larry Granroth)
- Subject: Re: tape I/O under Unix: eof always true?
- Message-ID: <C07J1y.CwE@space.physics.uiowa.edu>
- Organization: The University of Iowa, Department of Physics and Astronomy
- X-Newsreader: TIN [version 1.1 PL8]
- References: <1992Dec31.141848.354@ll.mit.edu>
- Date: Sat, 2 Jan 1993 03:29:56 GMT
- Lines: 45
-
- 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
-