home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1999 April / CD_Shareware_Magazine_31.iso / WIN95 / INTERNET / ftpctrl3b8.exe / %MAINDIR% / Scripts / Example12.ftp < prev    next >
Encoding:
Text File  |  1999-02-07  |  1.8 KB  |  68 lines

  1. ; *****************************************************
  2. ; Example12.ftp
  3. ; =============
  4. ; This example shows how to check both remote and local 
  5. ; filesizes!
  6. ; -----------------------------------------------------
  7. ; This example also shows the use of these commands:
  8. ;    Message "text..."
  9. ;    INPUT (into a variable)
  10. ;    Variable checking
  11. ; -----------------------------------------------------
  12. ; NOTE: This is just a sample - you are unable to 
  13. ; execute the script unchanged... ;o)
  14. ; *****************************************************
  15.  
  16. ; ******* First provide the Login information...
  17.  
  18. ; DialEntry="xxxxxxx"
  19. ; DialLoginUser="xxxxxxx"
  20. ; DialLoginPassword="xxxxxxx"
  21. Host=ftp.yourhost.net
  22. Port=21
  23. User=your.username
  24. Password=your.password
  25. ; Proxy=
  26. ; ProxyPort=21
  27.  
  28. ; ******* Timeout in seconds...
  29. Timeout=120
  30.  
  31. ; ******* ...Dial up if not already connected to the Internet...
  32. ; Dial
  33.  
  34. ; *******  ...and then connect to FTP host...
  35. connect
  36.  
  37. ; *******  Command sequence...
  38.  
  39. remote-cd  "/myfiles"
  40.  
  41. ; Start of transfer part:
  42. :Transfer
  43.   binary
  44.   send "c:\autoexec.bat" "autoexec.bat"
  45.   ; Check if files have identical sizes...
  46.   if Local-FileSize("c:\autoexec.bat") = Remote-FileSize("autoexec.bat") then
  47.      Message "Send completed successfully" 
  48.   endif
  49.   if Local-FileSize("c:\autoexec.bat") != Remote-FileSize("autoexec.bat") then
  50.      Let A = Local-FileSize("c:\autoexec.bat")
  51.      Let B = Remote-FileSize("autoexec.bat")
  52.      Message "Sizes mismatch: Local: %%A%%  Remote: %%B%%"
  53.      Input C "Want to try transfering again (Y/N)?"
  54.      if %%C%% = "Y" then 
  55.         goto Transfer
  56.      endif 
  57.      if %%C%% = "y" then 
  58.         goto Transfer
  59.      endif 
  60.   endif 
  61. ; End of transfer
  62.  
  63. ; *******  Afterwards, disconnect from host!
  64. disconnect
  65.  
  66. ; *******  At last, Hangup Internet connection!
  67. ; Hangup
  68.