[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

upload file and estimation time

whatazor

1/12/2008 10:10:00 AM

Hi all,
unseccsefully, I try to analyze this problem. If I can only work on
the client size, how can I create a module that calculate the upload
time of a file, so the time for finish it? i can start with ftp
protocol and after extend this logic for my requirements.

thx

w
1 Answer

Diez B. Roggisch

1/12/2008 1:19:00 PM

0

whatazor schrieb:
> Hi all,
> unseccsefully, I try to analyze this problem. If I can only work on
> the client size, how can I create a module that calculate the upload
> time of a file, so the time for finish it? i can start with ftp
> protocol and after extend this logic for my requirements.

All you need to to is to

- count the number of bytes to transfer, U

- count the bytes already transfered, u

- measure the time since the upload, t



Then the ETA is

eta = (u / t) * (U - u)

Using the ftp-lib, you best pass a file-wrapper that overload the
read-method to accumulate the read bytes to yield u.

Diez