From: rohit2000s@... Date: 2007-12-21T19:20:00+09:00 Subject: Binary file reading in Ruby Hi All, I am trying to read in a binary file of size 'n' using: mem_buf = IO.read(file_name, n, 0) Where file_name is an argument to the script. But after the read I observed that the size of the mem_buf is less than 'n' (It should be equal to 'n'). (mem_buf.size != n). This script fails on the above read check. Any ideas what I might be doing wrong here. Any help will be appreciated. Thanks in advance, Rohit