我正在尝试使用Node.js将数据附加到日志文件,并且工作正常,但它不会进入下一行. \n
似乎没有在我的功能下面工作.有什么建议?
function processInput ( text )
{
fs.open('H://log.txt', 'a', 666, function( e, id ) {
fs.write( id, text + "\n", null, 'utf8', function(){
fs.close(id, function(){
console.log('file is updated');
});
});
});
}
Run Code Online (Sandbox Code Playgroud)