home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
dragen1.zip
/
append.cmd
next >
Wrap
OS/2 REXX Batch file
|
2000-02-12
|
2KB
|
79 lines
/* append copyright 2000, Keith Cotroneo */
echo off
filesize=0
killtest=1
do while lines(append.var)
szlocal=linein(append.var)
vfile=linein(append.var)
parse var szlocal fsize localfile porttype
/*say fsize localfile vfile*/
if left(localfile,1)="'" then
do
localtmp=left(localfile,(length(localfile)-1))
localtmp=right(localtmp,(length(localtmp)-1))
rc=sysfiledelete(localtmp)
if rc \= 0 then
say localtmp": ready for download"
else
say localtmp": deleted, file will be replaced"
end
else
do
rc=sysfiledelete(localfile)
if rc \= 0 then
say localfile": ready for download"
else
say localfile": deleted, file will be replaced"
end
getstr= "get2 -a:"porttype" "vfile
/*say getstr*/
getstr
/* check to see if get2 could not get the host*/
/* if ktest is on the drive, abort */
killtest=linein(ktest)
rc=stream(ktest,'c','close')
if killtest=0 then
do
rc=stream(append.var,'c','close')
exit
end
filesize=0
do while filesize < fsize
if left(localfile,1)="'" then
do
localf=left(localfile,(length(localfile)-1))
localf=right(localf,(length(localf)-1))
end
else
do
localf=localfile
end
say "localf is " localf
call SysFileTree localf, 'nfile', 'F'
if nfile.0=0 then
do
say "file not found"
rc=stream(localf,'c','close')
filesize=0
end
else
do
say nfile.1
parse VAR nfile.1 date time filesize name
say nfile.1"="filesize" file = "fsize
end
call syssleep 1
if filesize < fsize then
do
say "Restarting download to get the rest of the file...."
getstr = "get2 -a:"porttype" "vfile
/*say getstr*/
getstr
end
end
end
filesize=0
rc=stream(append.var,'c','close')
getstr="echo 1 > lwin"
getstr