will's stuff
Showing posts with label
ruby
.
Show all posts
Showing posts with label
ruby
.
Show all posts
Tuesday, November 6, 2012
reading binary files in ruby
Let's say you have a binary file filled with a bunch of doubles:
File.open("file_name","r") do |file| while !file.eof? puts file.read(8).unpack('D')[0] end end
Older Posts
Home
Subscribe to:
Posts (Atom)