home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / djin2g1.zip / filesiz.cmd next >
OS/2 REXX Batch file  |  1995-06-16  |  1KB  |  38 lines

  1. /* this prog returns file size, if file exists */
  2. parse arg path file.0 file.1 file.2 file.3 file.4 file.5 file.6 file.7 file.8 file.9
  3. dccfil =stream('filedesc.dat','command','query exists')
  4. if dccfil <> '' then 'del filedesc.dat'
  5. temp='';
  6.           do jj=1 to length(path)
  7.              ltr=substr(path,jj,1)
  8.              if ltr='/' then ltr='\';
  9.               temp=temp || ltr
  10.           end /* do */
  11.         path=temp || '\'
  12. goodfiles = 0
  13. do ii = 0 to 9
  14.        if file.ii <> '' then do
  15.         temp=path || file.ii
  16.         dccfil=stream(temp,'command','query exists')
  17.         if dccfil <> '' then do
  18.           dccsiz=stream(temp,'command','query size');
  19.           goodfiles=goodfiles + 1;
  20.           temp='';
  21.           do jj=1 to length(dccfil)
  22.              ltr=substr(dccfil,jj,1)
  23.              if ltr='\' then do  
  24.                 ltr='';
  25.                 temp=''
  26.                 end;
  27.              if ltr=':' then ltr=''
  28.              temp=temp || ltr
  29.           end /* do */
  30.           dccfil=temp
  31.           'echo ^assign FILELIST['goodfiles'] 'dccfil ' >> filedesc.dat';
  32.           'echo ^@ FILELENG['goodfiles'] = 'dccsiz ' >> filedesc.dat';
  33.         end;
  34.       end;
  35. end /* do */
  36. 'echo @ FILECOUNT = 'goodfiles' >> filedesc.dat'
  37.  
  38.