Skip to content

Instantly share code, notes, and snippets.

@domgetter
Created August 14, 2013 03:19
Show Gist options
  • Save domgetter/6227735 to your computer and use it in GitHub Desktop.
Save domgetter/6227735 to your computer and use it in GitHub Desktop.
> ruby pos_test.rb
First position: 0
Got byte: 82
Final position: 6722
file = File.new("test.wav", "r")
puts "First position: #{file.pos}"
char = file.getbyte
puts "Got byte: #{char}"
file.pos
puts "Final position: #{file.pos}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment