>>9
a.datって中に改行ある?

なんとなく、
  File.open('./a.dat', 'rb') do |f|
    while str = f.read(1024); print str; end
  end
とすればいいような気がするが、試してないし根拠もない。