Skip to content

Instantly share code, notes, and snippets.

@zeroeth
Created February 17, 2011 22:19
Show Gist options
  • Select an option

  • Save zeroeth/832858 to your computer and use it in GitHub Desktop.

Select an option

Save zeroeth/832858 to your computer and use it in GitHub Desktop.
io = File.open(...)
len = io.read(2).unpack("v")[0]
name = io.read(len)
width, height = io.read(8).unpack("VV")
puts "Rectangle #{name} is #{width} x #{height}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment