I'm new to Node.js and I'm trying to figure out what is wrong with the following code.
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;
}
When running this code I get the error:
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)
Hiberfil.sys is a system file that holds the hibernation data onto disk, you cannot just read it via normal rights, it's super confidential since it hold all memory information on disk.
After having a similar issue without finding a sufficient answer:
I have fixed it by searching for circular dependencies.
After fixing it, I was able to run everything normally.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With