fs.js 272 B

12345678910111213
  1. var fs = require("fs");
  2. var path = "/Users/john/Desktop/test.mp41";
  3. fs.stat(path,function(err,stats)
  4. {
  5. console.info(err);
  6. });
  7. var path = "/Users/john/Desktop/test.mp4";
  8. fs.lstat(path,function(err,stats)
  9. {
  10. console.info(err==null);
  11. console.info(stats.size);
  12. });