home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / idlpvwa / 572 < prev    next >
Encoding:
Text File  |  1992-12-23  |  1.2 KB  |  47 lines

  1. Newsgroups: comp.lang.idl-pvwave
  2. Path: sparky!uunet!wupost!crcnis1.unl.edu!moe.ksu.ksu.edu!hobbes.physics.uiowa.edu!ljg
  3. From: ljg@space.physics.uiowa.edu (Larry Granroth)
  4. Subject: reading multiple tape files
  5. Message-ID: <BzqxwA.2Ao@space.physics.uiowa.edu>
  6. Organization: The University of Iowa, Department of Physics and Astronomy
  7. X-Newsreader: TIN [version 1.1 PL8]
  8. Date: Thu, 24 Dec 1992 04:31:18 GMT
  9. Lines: 36
  10.  
  11.  
  12. Can anyone suggest a good way of reading multiple files from a tape
  13. device in (Unix) IDL?  EOF() doesn't work with a tape file.  I can
  14. do something like:
  15.  
  16. openr,1,'/dev/nrst0'
  17.  
  18. while more_files_on_tape do begin
  19.  
  20.   !error=0
  21.   on_ioerror, done
  22.  
  23.   while (1) do begin
  24.     readu,1,buf
  25.     ; . . . process data ...
  26.   endwhile
  27.  
  28.   done:
  29.  
  30.   if !error then print, !err_string
  31.   !error = 0
  32.   on_ioerror, null
  33.  
  34. endwhile
  35.  
  36. This will work to read a single file at a time, but the on_ioerror
  37. immediately jumps to "done" on any attempt to read more than one file.
  38. Also, I'm not really sure how to test for "more_files_on_tape", except
  39. maybe checking for a "zero-length" file which might be a result
  40. of two consecutive tape marks.
  41.  
  42. Thanks for any info.
  43.  
  44. Happy Holidays.
  45.  
  46. larry-granroth@uiowa.edu
  47.