home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
djin2g1.zip
/
filesiz.cmd
next >
Wrap
OS/2 REXX Batch file
|
1995-06-16
|
1KB
|
38 lines
/* this prog returns file size, if file exists */
parse arg path file.0 file.1 file.2 file.3 file.4 file.5 file.6 file.7 file.8 file.9
dccfil =stream('filedesc.dat','command','query exists')
if dccfil <> '' then 'del filedesc.dat'
temp='';
do jj=1 to length(path)
ltr=substr(path,jj,1)
if ltr='/' then ltr='\';
temp=temp || ltr
end /* do */
path=temp || '\'
goodfiles = 0
do ii = 0 to 9
if file.ii <> '' then do
temp=path || file.ii
dccfil=stream(temp,'command','query exists')
if dccfil <> '' then do
dccsiz=stream(temp,'command','query size');
goodfiles=goodfiles + 1;
temp='';
do jj=1 to length(dccfil)
ltr=substr(dccfil,jj,1)
if ltr='\' then do
ltr='';
temp=''
end;
if ltr=':' then ltr=''
temp=temp || ltr
end /* do */
dccfil=temp
'echo ^assign FILELIST['goodfiles'] 'dccfil ' >> filedesc.dat';
'echo ^@ FILELENG['goodfiles'] = 'dccsiz ' >> filedesc.dat';
end;
end;
end /* do */
'echo @ FILECOUNT = 'goodfiles' >> filedesc.dat'