FTP status problems. (Again)

Nainto Nainto at gmail.com
Sat Sep 17 17:52:14 EDT 2005


Unfortunatly I stiill get the same error. :-(
Here is the code:
import ftplib
class ProgressFile(file):
	def read(self, size = None):
		from sys import stdout
		if size is not None:
			buff = file.read(self, size)
			if buff:
				stdout.write('.')
			else:
				stdout.write('\n')
			return buff
		else:
			buff = ''
			while True:
				new_str = file.read(self, 1024)
				stdout.write('.')
				if new_str:
					buff = buff + new_str
				else:
					stdout.write('\n')
					break
				return buff
if __name__ == '__main__':
	ftp = ftplib.FTP("ftp.sadpanda.cjb.cc")
	ftp.login("sadpanda","PASSWORDEDITIEDOUT")
	filename = "/FrenchBrochure.pages.zip"
	ftp.storbinary("STOR " + filename, ProgressFile(filename, "rb"), 1024)

	ftp.quit()


Thanks again.




More information about the Python-list mailing list