From: Gary Wright Date: 2007-03-26T12:50:20+09:00 Subject: Re: Read only a few bytes from file On Mar 25, 2007, at 6:15 PM, toulax@gmail.com wrote: > I tested on a URL with around 200kb and it took the exact same time > reading it all vs reading only 8 bytes. I believe this is done in PHP > via sockets, isn't the same possible with Ruby? Absolutely. require 'open-uri' text = open("http://www.google.com") { |f| f.read(8) } puts "first eight bytes is: #{text}" Gary Wright