home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / extract4.zip / killlost.cmd < prev    next >
OS/2 REXX Batch file  |  1994-09-26  |  926b  |  39 lines

  1. /* This batch is an optional utility. It will read EXTRACT.SUM
  2.    and DELETE the files in your PARTIAL dir that are NOT defined
  3.    in extract.sum..
  4. */
  5.  
  6. e. = 0
  7. r = 'EXTRACT.SUM'  /* you may specify exact path here */
  8.  
  9. do lines=1 while lines(r)
  10.   l = linein(r)
  11.   parse var l '"'fn'","'full'",'one','two','three .
  12.   if words(fn full one two three)¬=5 then do
  13.      say 'warning: line' lines 'is invalid!'
  14.   end
  15.   fn = translate(translate(fn,'_','.'))
  16.   e.fn = 1
  17. end
  18. w = lineout(r,,)
  19. 'RXQUEUE /CLEAR'
  20. 'DIR /B \DOCS\S\PARTIAL | RXQUEUE'
  21. alldel = 0
  22. do i=1 to queued()
  23.   parse pull fn.i .
  24. end
  25. say i-1 'Files.'
  26. do j=1 to i-1
  27.   fn=fn.j
  28.   fn2 = translate(fn,'_','.')
  29.   if e.fn2 then iterate
  30.   if alldel=0 then do
  31.     Say fn 'is not mentioned in EXTRACT.SUM. Erase? (Y/n/a)'
  32.     pull yn .
  33.     if left(yn,1)='A' then alldel=1
  34.     if left(yn,1)='N' Then iterate
  35.   end
  36.   'ERASE \DOCS\S\PARTIAL\'fn
  37. end
  38.  
  39.