Skip to content

Instantly share code, notes, and snippets.

@niklasfi
Created January 26, 2011 13:13
Show Gist options
  • Save niklasfi/796663 to your computer and use it in GitHub Desktop.
Save niklasfi/796663 to your computer and use it in GitHub Desktop.
var sys = require('sys'),
fs = require('fs');
var b=new Buffer('hello world');
fs.open('test','w',undefined, function(err,fd){
if(err) throw err;
fs.write(fd,b,0,b.length,3,function(err,written){
console.log(written + " bytes were written");
fs.close(fd);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment