Re: [Tutor] copy files + directory tree via ftp
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 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] copy files + directory tree via ftp
Hello I have a problem when copy files and directory tree in ftp, scripts in here only copy one file: from ftplib import FTP rootList = [] session = FTP() session.connect('workstation', port=21) session.login(user='saiki', passwd='saiki') session.retrlines('LIST', rootList.append) f=open('D:/PARAMS.LST','rb') session.storbinary('STOR '+"af", f, 1024) f.close() session.close() f anyone has any ideas I would appreciate it. Thank you Nelson Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. http://mobile.yahoo.com/go?refer=1GNXIC ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor