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

  1. ; *****************************************************
  2. ; Example10.ftp
  3. ; =============
  4. ; This example WAITS until a specified REMOTE file exists
  5. ; on the server, and when it does, it is retrieved.
  6. ; -----------------------------------------------------
  7. ; This example also shows the use of these commands:
  8. ;    GOTO
  9. ;    LOCAL-COPY
  10. ; -----------------------------------------------------
  11. ; NOTE: This is just a sample - you are unable to 
  12. ; execute the script unchanged... ;o)
  13. ; *****************************************************
  14.  
  15. ; ******* First provide the Login information...
  16.  
  17. Host="ftp.yourhost.net"
  18. Port=21
  19. User="your-username"
  20. Password="your-password"
  21.  
  22. ; ******* Timeout in seconds...
  23. Timeout=60
  24.  
  25. ; *******  ...and then connect to FTP host...
  26. connect
  27.  
  28. ; *******  Command sequence...
  29. ; ###  Wait for the file to exist...
  30. :CheckZone
  31.   if remote-exists("/mymata/files/myfile.dat") then
  32.      goto Fileexists
  33.   endif
  34.   ; Wait 20 seconds and then try again:
  35.   Waitseconds "20"
  36.   goto CheckZone
  37.  
  38. :FileExists
  39. ; ###  Wait 4 second until retrieving it... (just an example ;o)
  40. Waitseconds "4"
  41.  
  42. Binary
  43. get "/mymata/files/myfile.dat" "D:\MyData\Files\Myfile.dat"
  44. Local-copy "D:\MyData\Files\Myfile.dat" "E:\MyData\Backup\Myfile.dat"
  45.  
  46. ; *******  Afterwards, disconnect from host!
  47. disconnect
  48.  
  49.