node/test/simple.js

19 lines
473 B
JavaScript
Raw Normal View History

2009-04-16 17:37:44 +08:00
var f = new File;
f.onError = function (call) {
node.blocking.print("file error with " + call );
}
f.onOpen = function () {
node.blocking.print("file opened.");
f.write("hello world\n", function (status, written) {
node.blocking.print("written. status: "
+ status.toString()
+ " written: "
+ written.toString()
);
f.close();
});
};
f.open("/tmp/world", "a+");