From: Mariano Kamp Date: 2006-12-24T00:57:05+09:00 Subject: Re: Question: Downloading files with open(-uri)? --Apple-Mail-3--396340201 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Dec 23, 2006, at 4:30 PM, Robert Klemme wrote: > I observe the same behavior that you see. I have no knowledge of > openuri internals but here's my theory: the page is probably loaded > completely before open returns. This would explain why you see the > dots from ibm.com in one go. I would test the same with net/http > and see whether there is any difference. Make sure to use the > stream form. Ok, that makes sense. I changed the code accordingly and now I get the following: RubyMate r5712 running Ruby v1.8.4 (/usr/local/bin/ruby) >>> download2.rb Downloading http://ibm.com buffer size=227 done. Downloading http://downloads.scribemedia.net/ rails2006/03_martin_fowler_full.m4v buffer size=708 buffer size=416 buffer size=1024 buffer size=416 buffer size=1024 buffer size=416 buffer size=1024 buffer size=416 buffer size=1024 buffer size=416 buffer size=1024 buffer size=416 buffer size=1024 buffer size=416 So it seems to work... I am just not so sure if this is the right buffer size? I guess 1024 +416=1440 is the size of my PPOE packages, but I think at least 8KB would be more efficient. Cheers, Mariano --Apple-Mail-3--396340201--