Read one byte from a binary file : Binary File « File Directory « Ruby






Read one byte from a binary file



f = open('binary')
puts f.pos                                
puts f.read(1)                            
puts f.pos                                

 








Related examples in the same category

1.Processing a Binary File
2.Read a binary file by byte
3.Move file position
4.Seek by position
5.File read 500 bytes
6.Open a binary file with rb+