[ftputil] FTP Transfer Progress // Multiple Threads

Stefan Schwarzer sschwarzer at sschwarzer.net
Sat Oct 20 21:46:58 CEST 2007


Hello Franz,

On 2007-10-19 22:21, Franz Buchinger wrote:
> thanks for this fascinating library!

:-)

> How can I measure the progress of an FTP down/upload? Can I do this with
> a callback function that is triggered by the FTPHost instance or are
> there other ways?

Unfortunately, there's no elegant way to track the progress of
uploads/downloads. A workaround could be to "stat" the target file
at certain intervals and use the results.

Besides, there's actually a ticket on the subject
( http://ftputil.sschwarzer.net/trac/ticket/20 ), so I should work
on this when I can get some time for it.

> As far as I understood the docs, FTPUtil is not 100% thread-safe, but I
> can have multiple file transfers at once by spawning a download thread
> for each FTPUtil file object. Is this correct?

If you use a distinct instance of FTPHost for each thread, that
should be safe.

I hope this helps a bit. Feel free to ask if you have any more
questions.

Regards,
Stefan


More information about the ftputil mailing list