Ftp : how to know downloading data is completed?
-
here is data (in ASCII format) downloaded from server by command "LIST":
total 1100
-rw------- 1 root 38 Dec 16 2010 .bash_history
(omitting several lines here)
drwx--x--x 6 other 512 Oct 13 2005 usrMy question is: How do I know the downloading is completed? I guess I need to send count of bytes downloaded to server, so server will tell if downloading is OK. If so, What instruction (command) should I send to server? Which port (command port or data port) should I use for sending the instruction? Thanks. .
-
here is data (in ASCII format) downloaded from server by command "LIST":
total 1100
-rw------- 1 root 38 Dec 16 2010 .bash_history
(omitting several lines here)
drwx--x--x 6 other 512 Oct 13 2005 usrMy question is: How do I know the downloading is completed? I guess I need to send count of bytes downloaded to server, so server will tell if downloading is OK. If so, What instruction (command) should I send to server? Which port (command port or data port) should I use for sending the instruction? Thanks. .
Is this something to do with C++ or are you just trying to understand how to use FTP? If you are doing this programmatically then you just keep reading the socket until no more data is presented.
includeh10 wrote:
Which port (command port or data port) should I use
Not sure that I understand your question here; what do you mean by "command port or data port"?
-
here is data (in ASCII format) downloaded from server by command "LIST":
total 1100
-rw------- 1 root 38 Dec 16 2010 .bash_history
(omitting several lines here)
drwx--x--x 6 other 512 Oct 13 2005 usrMy question is: How do I know the downloading is completed? I guess I need to send count of bytes downloaded to server, so server will tell if downloading is OK. If so, What instruction (command) should I send to server? Which port (command port or data port) should I use for sending the instruction? Thanks. .