/* писано на бобике */ /* Pasha, 2008/01 */ /* Requirements: system x:\tcpip\dll\rxftp.dll */ /* read more: x:\tcpip\help\rxftp.inf */ /* Usage: upload-to-ftp.cmd myfile.dat */ Arg File call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' call SysLoadFuncs call RxFuncAdd 'SysIni', 'RexxUtil', 'SysIni' rc = RxFuncAdd("FtpLoadFuncs","rxFtp","FtpLoadFuncs") rc = FtpLoadFuncs() RemoteHost = 'ftp.microsoft.com' Users = 'myuser' Password = 'mypassword' OutDir = '/u/spool/TO_OFFICE' say 'Connecting 'RemoteHost rc=FtpSetUser(RemoteHost,Users,Password) if rc \= 1 then do say 'Error connect 'RemoteHost' rc='rc exit end rc=FtpSetBinary("Binary") if rc \= 1 then do say 'Error set binary 'RemoteHost' rc='rc rc=FtpLogoff() exit end rc=FtpSetActiveMode("0") if rc = -1 then do say 'Error ls 'RemoteHost' rc='FTPERRNO rc=FtpLogoff() exit end rc=FtpLs("*.zip","files.") if rc = -1 then do say 'Error ls 'RemoteHost' rc='FTPERRNO rc=FtpLogoff() exit end say 'List' do i=1 to files.0 Say '->' files.i end if File == "" then exit Say 'File to send ' File rc = FtpPut(File,File,"Binary") if rc == -1 then do say 'Error transfer 'RemoteHost' file ' File ' rc='FTPERRNO rc=FtpLogoff() exit end /* call SysFileDelete(files.i) end */ rc=FtpLogoff() if rc == -1 then do say 'Error logoff 'RemoteHost' rc='rc exit end exit