Created
October 15, 2013 16:10
-
-
Save janpieper/6994063 to your computer and use it in GitHub Desktop.
rm /tmp/foo && touch /tmp/foo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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