[Twisted-Python] FTPClient storeFile help.

Oisin Mulvihill oisin at enginesofcreation.ie
Thu Oct 2 07:57:02 EDT 2003


In my current project I'm using python's ftplib to transfer
files. This is proving very slow and I need to improve this.

I looked at Twisted's protocol.ftp.FTPClient some time ago
and there seemed to be no support for uploading files. After
trawling through the comp.lang.python news group I saw
that this had changed in 1.0.4(?), so I decided to try FTPClient

I've attached a modified version of the ftpclient.py example
I'm using. When I run this I login my ftp server ok, do the pwd
ok & then proceed to the storeFile and nothing seems to
happen. When I look at the ftp server I find an empty file
with the correct name however the store operation never
seems to finish.

I confess I really don't know how to handle the two deferred
object that get returned by storeFile. I just add callback/
errorback for each, this could be the problem.

Can anyone enlighten me as to what I'm doing wrong. I would
really like to use proper async behavior for doing the uploads,
instead of using threads + ftplib.



P.S. my system: osx, python 2.2.3, twisted 1.0.7.

Oisin Mulvihill
Engines Of Creation

Email: oisin at enginesofcreation.ie
Work: +353 1 6791602
Mobile: +353 868191540

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ftpclient.py
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20031002/eb616a9c/attachment.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: myfile.txt
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20031002/eb616a9c/attachment-0001.txt 

More information about the Twisted-Python mailing list