我是Node.js的新手,我正试图找出以下代码的错误。
var fs = require('fs');
var dir = "C:\\";
var files = fs.readdirSync(dir);
for (var i = 0; i < files.length; i++) {
var name = fs.statSync(dir + files[i]).name;
}
运行此代码时出现错误:
Error: EBUSY, resource busy or locked 'C:\hiberfil.sys'
at Object.statSync (fs.js:424:18)
at Object.<anonymous> (S:\start.js:7:19)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
at Array.0 (module.js:484:10)
at EventEmitter._tickCallback (node.js:190:38)