home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / netutl1.zip / DTEMPS.CMD < prev    next >
OS/2 REXX Batch file  |  1995-01-03  |  2KB  |  43 lines

  1. /* A REXX program for deleting tempory files                            */
  2. /* Written by William M. Comegys II 76226,2747                          */
  3. /* Copywright 1995 William M. Comegys II                                */
  4. /* This program writes the files to be deleted to the out_file          */
  5. /* Which you can then edit                                              */
  6.  
  7. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'     /* load extra functions */
  8. call SysLoadFuncs
  9.  
  10. in_file = 'c:\util\dpurge.dat'                                /* Input file with valid file specs
  11.                                                                  examples
  12.                                                                  C:\DATA\MW*.TMP
  13.                                                                  *.BAK
  14.                                                               */
  15.  
  16. out_file = 'c:\util\dpurge.cmd'                               /* File which the file to be deleted are written to. */
  17.  
  18. call sysfiledelete out_file                                   /* Delete out_file this is so REXX doesn't append to the file */
  19.  
  20. /* trace(?I) */
  21.  
  22. call syscls
  23.  
  24. do while lines (in_file) > 0
  25.    In_file_data = linein(in_file)
  26.  
  27.    in_pos = length(In_file_data)                              /* Length of the string comming from the input file */
  28.    if in_pos = 0 then leave ;                                 /* If End Of File leave                       */
  29.  
  30.     say "Present file tree I'm on is  " In_file_data time()   /* Write inpuut file out to screen            */
  31.  
  32.      call sysfiletree  In_file_data, 'Delfiles', 'SFO'        /* Read directory of files from disk.         */
  33.  
  34.    do i=1 to Delfiles.0                                       /* Write files to be deleted out to screen    */
  35.      say Delfiles.i
  36.      Out_data = insert('del ', Delfiles.i)                    /* Append del to the front of the path        */
  37.      result = lineout(out_file, Out_data)
  38.   end
  39. end
  40.  
  41. exit
  42.  
  43.