title: how can I read a file, bytes at a time in Ruby?
body: <p>I want to iteratively read a fixed number of bytes in a file, and return them</p>
  
  <p>My code is below. I have taken it from an example on the internet</p>
  
  <pre><code>File.open('textfile.txt') do |file|
    while (buffer = file.read(size)) do
       yield buffer
    end
  end
  </code></pre>
  
  <p>I get the error no block given. </p>