From: Tim Hunter Date: 2008-01-02T03:56:27+09:00 Subject: Re: Best way to download >1GB files thefed wrote: > > On Dec 31, 2007, at 7:20 PM, Tim Hunter wrote: > >> thefed wrote: >>> But doesn't open-uri download the whole thing to your compy? I was >>> about to use it, but then I ran it in irb and saw it returned a file >>> object. >> >> Isn't that what you want to happen? I thought your question was about >> how to download it in small chunks so it's not all in memory at the >> same time. This code downloads the whole file, but 8kb at a time. > > No, I thought when you use Kernel#open with open-uri, it FIRST downloads > the entire 1GB file to your temp folder, and THEN runs your block on > that file in temp > Interesting. I just tried downloading a 6.1MB file with open-uri and didn't see that behavior. I'm using Ruby 1.8.6 on OS X 10.5. -- RMagick: http://rmagick.rubyforge.org/ RMagick 2: http://rmagick.rubyforge.org/rmagick2.html