Created
January 24, 2012 14:08
-
-
Save piscisaureus/1670344 to your computer and use it in GitHub Desktop.
This file contains hidden or 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'); | |
var buf = new Buffer(1024*1024); | |
buf.fill(42); | |
var fd = fs.openSync('file1', 'a+'); | |
console.log("fd A: " + fd); | |
for (i = 0; i < 100; i++) { | |
fs.write(fd, buf, 0, buf.length, i * buf.length, function(err) { | |
if (err) console.log(err); | |
}); | |
} | |
fs.closeSync(fd); | |
var fd2 = fs.openSync('file2', 'a+'); | |
console.log("fd B: " + fd2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment