Re: Problem with FTP

new topic     » goto parent     » topic index » view thread      » older message » newer message
SergioGelli said...

system("start /b ftp "&ftp_url_to_download&", 2) The program can find out if the operation is over?

No, not directly. If you know the size of the file being downloaded though then you can simply do a dir() on the file to find out if it is done yet or not.

Otherwise, the following batch script provides a work-around:

@echo off 
rem Lets assume this batch script is named ftpbatch.bat 
rem Usage: ftpbatch.bat ftp://site.tld/file/to/get c:\temp\ok_download_is_done.txt 
ftp "%1" 
echo %ERRORLEVEL% > "%2" 

and then you would do

system("start /b ftpbatch.bat "&ftp_url_to_download&" "&completion_file, 2) 

Then you could do a dir() on completion_file, and when it is created you know the ftp download is finished. (And if you need to see the exit code of ftp.exe to know if the download was successful or aborted, you can read the exit code in the file.)

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu