[Tutor] copy files + directory tree via ftp

Kent Johnson kent37 at tds.net
Wed Sep 26 13:00:24 CEST 2007


Nelson Kusuma wrote:
> Hello
> 
> I have a problem when copy files and directory tree in
> ftp, scripts in here only copy one file:

To transfer an entire directory with ftplib you will have to read the 
local directory with os.listdir() and loop to send the files.

There are a few higher-level modules written on top of ftplib that might 
be helpful directly or as examples:
http://pypi.python.org/pypi/ftputil/2.2.3 (site is down at the moment)
http://www.nedbatchelder.com/code/modules/ftpupload.html

Kent


More information about the Tutor mailing list