Created
August 14, 2013 03:26
-
-
Save domgetter/6227754 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> ruby pos_test.rb | |
First position: 0 | |
Got char: R | |
Second position: 6722 | |
Got char: █ | |
Final position: 14678 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file = File.new("test.wav", "r") | |
puts "First position: #{file.pos}" | |
char = file.getc | |
puts "Got char: #{char}" | |
puts "Second position: #{file.pos}" | |
char = file.getc | |
puts "Got char: #{char}" | |
puts "Final position: #{file.pos}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment