/* Connect to datafellows FTP site, see if they have update */ /* for macro.def signature file */ /* Note - by editing the following 4 lines you can use this program to update other files! Assumption that newer files are bigger is true for definition files and probably will apply to other stuff as well. */ FILES='macrdef2.zip fp-def.zip' SITE='ftp.complex.is' /* use original ite, it seems pretty fast! */ DIR='pub' CHECK='f-prot.exe' CALL SYSFILETREE CHECK, 'F.','F','*****','*****' IF F.0=0 THEN DO CALL MAY CHECK 'not found' EXIT 28 END CONN=0 DO I=1 TO WORDS(FILES) FI=WORD(FILES,I) PARSE VAR FI FN'.'FT CALL SYSFILETREE FI , 'F.','F','*****','*****' IF F.0>0 THEN DO LS=WORD(F.1,3) LT=F.1 END ELSE DO LS=0 LT=FI 'not found' END /* Size if file found, zero otherwise */ IF CONN=0 THEN DO /* Only load ftp libs once. Same for connecting to FTP site */ rc = RxFuncAdd("FTPLoadFuncs","rxFtp","FTPLoadFuncs") rc = FtpLoadFuncs() CALL MAY 'Connecting to' SITE'...' rc = FtpSetUser(SITE,'anonymous','-') CALL FtpChdir DIR CONN=1 END CALL FTPDIR FI, F. IF F.0=0 THEN DO CALL MAY 'Remote file' FI 'not found' ITERATE /* will try another file anyway */ END RS=WORD(F.1,5) IF RS>LS THEN DO CALL MAY 'Local:' LT CALL MAY 'Remote:' F.1 IF LS>0 THEN 'COPY' FI FN'.old' CALL MAY 'Remote file' FI 'is larger, downloading...' CALL SysFileDelete FN'.old' CALL FTPGET FI,FI UI=UPPER(FI) IF POS('ZIP',UI)>0 THEN 'PKUNZIP -o' FI END ELSE CALL MAY 'Local file' FI 'is same or bigger - no changes' END rc = FtpLogoff() CALL FtpDropFuncs EXIT MAY:PROCEDURE PARSE ARG M SAY M CALL LINEOUT "fprot.log", DATE() TIME() M RETURN UPPER:PROCEDURE RETURN TRANSLATE(ARG(1))