By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,538 Members | 1,337 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,538 IT Pros & Developers. It's quick & easy.

ftp mget

P: n/a
Anybody know if there's an ftp client in python that can do an mget?

My current implementation of an mget uses ftpconnection.nlst() to retrieve
the list of filenames. Then iterates through this list with
retrlines('RETR ' + fname,callback).

I'd like to eliminate a LIST command on the ftp server altogether.

Thanks to all.

Allan
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Thu, 2004-03-25 at 18:54, allanc wrote:
Anybody know if there's an ftp client in python that can do an mget?

My current implementation of an mget uses ftpconnection.nlst() to retrieve
the list of filenames. Then iterates through this list with
retrlines('RETR ' + fname,callback).

I'd like to eliminate a LIST command on the ftp server altogether.

Thanks to all.

You may want to look in the python distribution at the script
Tools/scripts/ftpmirror.py. It's referenced on the module documentation
page for ftplib.
It basically does what you're doing - parsing text returned by the LIST
command. It will probably give you some ideas, or let you know whether
you're barking up the wrong tree.

Rich

Jul 18 '05 #2

P: n/a
allanc <al****************@nospamyahoo.com> writes:
Anybody know if there's an ftp client in python that can do an mget? My current implementation of an mget uses ftpconnection.nlst() to retrieve
the list of filenames. Then iterates through this list with
retrlines('RETR ' + fname,callback). I'd like to eliminate a LIST command on the ftp server altogether.


A quick scan of the FTP RFC at:

http://www.w3.org/Protocols/rfc959/Overview.html

(specifically "file transfer functions") suggests that there is no command to
get multiple files by globbing and that you have to do it this way.

Eddie
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.