Basically, I like to know how "mget" command work in terms of data/control channels and in terms of request-respond dialogue.
Also, when I try the command as an example below, is it true than for each file to be transferred, there is a new connection establish? (ie. transferred one file, disconnect, reconnect for another file) or do all files get transferred in one connection?
Thanks
==
ftp> mget *.txt
200 Type set to A.
mget userb.txt? y
200 PORT command successful.
150 ASCII data connection for userb.txt (203.173.129.136,3816) (26 bytes).
226 ASCII Transfer complete.
ftp: 31 bytes received in 0.01Seconds 3.10Kbytes/sec.
mget userc.txt? y
200 PORT command successful.
150 ASCII data connection for userc.txt (203.173.129.136,3817) (28 bytes).
226 ASCII Transfer complete.
ftp: 33 bytes received in 0.02Seconds 1.65Kbytes/sec.
mget userd.txt? y
200 PORT command successful.
150 ASCII data connection for userd.txt (203.173.129.136,3819) (27 bytes).
226 ASCII Transfer complete.
ftp: 32 bytes received in 0.02Seconds 1.60Kbytes/sec.
mget allows you to use wildcard characters in file names, then asks whether this file is the one you want. mget/mput is just a somewhat semi-automated way to transfer multiple files with one command. It's really no different than requesting one file at a time with get/put, no connections are disconnected/reconnected. -mk
I must disagree with mikek147. The ftp protocol has a control socket and a data socket. The control socket stays open for the entire session. This is how you send commands to the server. But a data socket is opened for each file. I would not use the term "disconnect". But with each data socket, one side is writing the data and the other side is reading the data. When the entire file has been sent, the writer closes the socket. This causes the reader to see end-of-file with the next read. The reader then closes its end of the socket. If another file is to be transferred, another data socket will be opened.