File Directory Ruby

require 'socket'
require 'stringio'
sock = TCPSocket.open("www.example.com", 80)
sock.write("GET /\n")
file = StringIO.new(sock.read)
file.read(10)                                   # => "\r\nfile.rewind
file.read(10)                                   # => "\r\nfile.pos = 90
file.read(15)                                   # => " this web page "