[Tutor] ftplib.storbinary and using a progress bar

Terry Carroll carroll at tjc.com
Sun Sep 7 06:20:30 CEST 2008


On Sat, 6 Sep 2008, johnf wrote:

> I'm currently using ftplib.storbinary() to upload a file to a FTP server.  
> However, I would like to inform the user of the progress being made during 
> the file transfer (it could be a very long transfer).  But 
> ftplib.storbinary() has no callback like retrbinary() so does anyone have a 
> thought on how I can update my user on the progress of the transfer.  

Callbacks are being added in 2.6, and are in the 2.6 source now.  You can
download the current version of ftplib at
http://svn.python.org/view/python/trunk/Lib/ftplib.py?rev=63788&view=log

When I do something along these lines, I save it (usually under the 
local directory of the python program that uses it) under a modified name, 
i.e. "ftplib26.py" or "myftplib.py"; then import with:

  import ftplib26 as ftplib


 



More information about the Tutor mailing list