Skip to content

Instantly share code, notes, and snippets.

@janpieper
Created October 15, 2013 16:10
Show Gist options
  • Save janpieper/6994063 to your computer and use it in GitHub Desktop.
Save janpieper/6994063 to your computer and use it in GitHub Desktop.
rm /tmp/foo && touch /tmp/foo
var fs = require("fs");
function read(fd) {
var buf = new Buffer(8);
fs.read(fd, buf, 0, buf.length, null, function () {
console.log(buf);
read(fd);
});
}
fs.open("/tmp/foo", "r", function (err, fd) {
read(fd);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment