ftp mget

Rich Krauter rmkrauter at yahoo.com
Thu Mar 25 20:08:28 EST 2004


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




More information about the Python-list mailing list