I'm trying to Append data to a Log file using Node.js and that is working fine but it is not going to the next line.
doesn't seem to be working in my function below. Any suggestions?
function processInput ( text )
{
fs.open('H://log.txt', 'a', 666, function( e, id ) {
fs.write( id, text + "
", null, 'utf8', function(){
fs.close(id, function(){
console.log('file is updated');
});
});
});
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…