[Pharo-users] Zinc downloadTo: help required

Chris cpmbailey at btinternet.com
Fri Jul 20 12:22:24 EDT 2012


On 20/07/2012 12:45, Sven Van Caekenberghe wrote:
> On 19 Jul 2012, at 21:09, Sven Van Caekenberghe wrote:
>
>> Yes, this seems to be a problem: your analysis is correct, since the size is unknown upfront - the whole idea of chunked transfer -, #streamFrom:to:size: in its current version cannot work. I will look at this tomorrow, I am pretty sure this can quite easily be fixed (minus the progress bar).
> I made some changes and commits. You can load the lastest version of Zn with the following load script
>
> Gofer it
>    squeaksource: 'ZincHTTPComponents';
>    package: 'Zinc-HTTP';
>    package: 'Zinc-FileSystem';
>    package: 'Zinc-Tests';
>    load
>
> If you are not on Pharo 2.0, use the following
>
> Gofer it
>    squeaksource: 'ZincHTTPComponents';
>    package: 'Zinc-HTTP';
>    package: 'Zinc-FileSystem-Legacy';
>    package: 'Zinc-Tests';
>    load
>
> Now, your example should work fine
>
> '/tmp/foo.txt' asFileReference ensureDeleted.
> ZnClient new url: 'http://www.google.com'; downloadTo: '/tmp/foo.txt'.
>
Thanks for that. I'm actually still having a bit of trouble when the 
file is bigger than the chunk size. 
ZnChunkedReadStream>>#readInto:startingAt:count: uses a limit variable 
which is bigger than the collection and requestedCount.

Regards,
Chris





More information about the Pharo-users mailing list