function OpenAndWrite(path, buffer){
	fs.open(path, 'a', function(err, fd) {
	    if (err) {
		console.log(err);
	    }
	 fs.writeFile(fd, new Buffer(buffer), (err) => {
    		if (err) throw err;
	}); 
	});
}
// open the file in writing mode, adding a callback function where we do the actual writing
open the file in writing mode, adding a callback function where we do the actual writing
open the file in writing mode adding a callback function where we do the actual writing
function OpenAndWrite(path, buffer){
	fs.open(path, 'a', function(err, fd) {
	    if (err) {
		console.log(err);
	    }
	 fs.writeFile(fd, new Buffer(buffer), (err) => {
    		if (err) throw err;
	}); 
	});
}
function OpenAndWrite ( path , buffer ) { fs . open ( path , 'a' , function ( err , fd ) { if ( err ) { console . log ( err ) ; } fs . writeFile ( fd , new Buffer ( buffer ) , ( err ) => { if ( err ) throw err ; } ) ; } ) ; }
open the file in writing mode, adding a callback function where we do the actual writing
open the file in writing mode adding a callback function where we do the actual writing