fs.access()判断文件和目录是否存在
dFile() 或 fs.writeFile() 之前使用 fs.access() 检查一个文件的可访问性 *///不建议使用:fs.access("./wenjian.txt",function(err){ if(!err){ console.log("文件已经存在"); return; } fs.open("./wenjian.txt",function(err){ console.log(err) })})//推荐使用;fs.open("./wenjian.txt",function(err,fd){ cnsole