home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / FF_200.ZIP / FFFTP.ZIP / FFFTP / GETFILE.CMD
OS/2 REXX Batch file  |  1995-08-24  |  1KB  |  67 lines

  1. trace off
  2.  
  3. /*------------------------------------------------------------------
  4.  * load functions, if needed
  5.  *------------------------------------------------------------------*/
  6. if RxFuncQuery("FtpLoadFuncs") then
  7.    do
  8.    rc = RxFuncAdd("FtpLoadFuncs","RxFtp","FtpLoadFuncs")
  9.    rc = FtpLoadFuncs()
  10.    end
  11.  
  12. if RxFuncQuery("SysLoadFuncs") then
  13.    do
  14.    rc = RxFuncAdd("SysLoadFuncs","RexxUtil","SysLoadFuncs")
  15.    rc = SysLoadFuncs()
  16.    end
  17.  
  18. /*------------------------------------------------------------------
  19.  * set up signal
  20.  *------------------------------------------------------------------*/
  21. signal on halt
  22.  
  23. /*------------------------------------------------------------------
  24.  * get parameters
  25.  *------------------------------------------------------------------*/
  26. parse arg site user pass ldir rdir file .
  27.  
  28. say "Start"
  29.  
  30. /*------------------------------------------------------------------
  31.  * set things
  32.  *------------------------------------------------------------------*/
  33. rc = FtpSetUser(site,user,pass)
  34. if rc <> 1 then
  35.    do
  36.    say "Error logon" FTPERRNO
  37.    call done
  38.    end
  39.  
  40. rc = FtpChDir(rdir)
  41. if rc <> 0 then
  42.    do
  43.    say "Error ChDir" FTPERRNO
  44.    call done
  45.    end
  46.  
  47. LEFT(ldir,2)
  48.  
  49. cd ldir
  50.  
  51. rc = FtpGet(file,file,"BINARY")
  52. if rc <> 0 then
  53.    do
  54.    say "Error Get" FTPERRNO
  55.    call done
  56.    end
  57.  
  58. say "OK"
  59.  
  60.  
  61. done:
  62. rc = FtpLogoff()
  63.  
  64. "C:\HSTART\HWAIT"
  65.  
  66. exit
  67.