title: TypeError: Bad argument using Node.js fs.read()
body: <p>I'm trying to get <code>fs.read()</code> to work but running into some issue(s). Here is my <code>fread.js</code> script: </p>
  
  <pre><code>var fs = require('fs');
  
  fs.open('test.txt', 'r', function (err, handle) {
  
      var f = handle;
      var b = new Buffer(100000);
  
      fs.read(f, b, 0, 100000, null, function (err, bytesRead) {
          console.log(b.toSting("utf8", 0, bytesRead));
          fs.close(f);
      });
  
  });
  </code></pre>
  
  <p>Why do I get the following <code>TypeError: Bad Argument</code> error upon running it?</p>
  
  <pre><code>$ node fread.js 
  
  fs.js:457
    binding.read(fd, buffer, offset, length, position, wrapper);
            ^
  TypeError: Bad argument
      at Object.fs.read (fs.js:457:11)
      at /home/max/dev/livelessons/fread.js:8:5
      at Object.oncomplete (fs.js:107:15)
  </code></pre>