Skip to content

Instantly share code, notes, and snippets.

@heapwolf heapwolf/53.js
Created Aug 7, 2012

What would you like to do?
var fs = require('fs');'./my_file_2.txt', 'a', function opened(err, fd) {
if (err) { throw err; }
var writeBuffer = new Buffer('writing this string'),
bufferPosition = 0,
bufferLength = writeBuffer.length, filePosition = null;
fs.write(fd, writeBuffer, bufferPosition, bufferLength, filePosition,
function wrote(err, written) {
if (err) { throw err; }
console.log('wrote ' + written + ' bytes');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.