title: Node.js and File System on Windows - EBUSY error
body: <p>I'm new to Node.js and I'm trying to figure out what is wrong with the following code.</p>
  
  <pre><code>var fs = require('fs');
  var dir = "C:\\";
  var files = fs.readdirSync(dir);
  for (var i = 0; i &lt; files.length; i++) {
      var name = fs.statSync(dir + files[i]).name;
  }
  </code></pre>
  
  <p>When running this code I get the error:</p>
  
  <pre><code>Error: EBUSY, resource busy or locked 'C:\hiberfil.sys'
      at Object.statSync (fs.js:424:18)
      at Object.&lt;anonymous&gt; (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)
  </code></pre>