help on file storage for split multi part download

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Mar 6 15:38:33 EST 2008


En Thu, 06 Mar 2008 14:34:27 -0200, <coolman.guron at gmail.com> escribi�:

> storage class which can write the file splits that are currently being
> downloaded to the disk. this is exactly what other download
> accelerators do, i guess.
>
> can this be done using the python file class?? i am pretty good at
> handling file uploads (at server end) this is the first time i have to
> think the other way round.

Uh, unless I misundersand you, a standard file object is enough. First  
create a file with the required size (open(...,'wb'), seek(n-1),  
write(chr(0))). For each downloaded chunk you have to know its position in  
the file; then just seek() and write() it.

-- 
Gabriel Genellina




More information about the Python-list mailing list