0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/mjsunit/test-eio-race2.js
Tim Caswell 6115df6338 File API tweaks
- Rename fs.cat to fs.readFile
- Move file.write to fs.writeFile
- Allow strings for the flag argument to fs.open
  ("r", "r+", "w", "w+", "a", "a+")
- Remove the unused 'File' module / class
2010-02-16 23:55:53 -08:00

21 lines
473 B
JavaScript

process.mixin(require("./common"));
var testTxt = path.join(fixturesDir, "x.txt");
var fs = require('fs');
setTimeout(function () {
// put this in a timeout, just so it doesn't get bunched up with the
// require() calls..
N = 30;
for (var i=0; i < N; i++) {
puts("start " + i);
fs.readFile(testTxt).addCallback(function(data) {
puts("finish");
}).addErrback(function (e) {
puts("error! " + e);
process.exit(1);
});
}
}, 100);