[Pharo-users] Zinc downloadTo: help required

Sven Van Caekenberghe sven at beta9.be
Fri Jul 20 07:45:40 EDT 2012


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'.

Sven


--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill








More information about the Pharo-users mailing list