2012-01-12 54 views

回答

2
fs = require('fs');   
fs.exists(path, function(exists) {   
    console.log((exists ? "File is there" : "File is not there"));   
}); 
+1

fs = require('fs'); console.log(fs.statSync(path).isFile()); // 对或错 – 2013-05-27 14:08:14

相关问题