home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / lorautil.zip / ZERO.CMD < prev   
OS/2 REXX Batch file  |  1994-04-14  |  1KB  |  44 lines

  1. /* REXX */
  2.  
  3. /* ZERO.CMD - deletes zero byte files in the outbound subdirectories */
  4. /* version 1.1 - 14 April, 1994 by Elliott Goodman */
  5.  
  6. /* check whether RxFuncs are loaded. If not, load them. */
  7.  
  8. if RxFuncQuery('SysLoadFuncs') then
  9. do
  10.     call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  11.     call SysLoadFuncs
  12. end
  13.  
  14. /* set up directories needed */
  15.  
  16. area.1 = 'd:\lora\outbound'
  17. area.2 = 'd:\lora\outbound.051'
  18. area.3 = 'd:\lora\OUTBOUND.04E'
  19. area.4 = 'd:\lora\outbound\00660527.PNT'
  20. area.5 = 'd:\lora\outbound.051\013B0001.PNT'
  21.  
  22. /* now cycle thru each directory */
  23.  
  24. do i = 1 to 5
  25.     newdir = area.i
  26.     call directory newdir
  27.     pattern = newdir||'\'
  28.     pattern = translate(pattern)    /* move to uppercase */
  29.     call SysFileTree '*', 'tfile', 'F'
  30.     if tfile.0 = 0 then do        /* no files present */
  31.         iterate            /* do next directory */
  32.         end
  33.     do k = 1 to tfile.0
  34.     parse upper var tfile.k . . size attrib name
  35.     if size = 0 then do
  36.         parse var name (pattern) dstuff '.' extn
  37.         if extn = 'ILO' | extn = 'CLO' | extn = 'DLO' | extn = 'FLO' | extn = 'BSY' then
  38.             iterate
  39.         parse upper var name (pattern) fname
  40.         dummy = SysFileDelete(fname) 
  41.         end
  42.     end
  43. end
  44.