joyent/node — Issue #2451: fs.rmdirSync() doesn't wait for directory deletion (at least on windows)
Author: eldargab
Created: 2012-01-02 17:32:54+00:00
State: open

Hi, following script executes 3 - 300 cycles in for loop and then outputs:
{ [Error: EACCES, permission denied 'C:\Users\Eldar\Desktop\dir']
errno: 3,
code: 'EACCES',
path: 'C:\\Users\\Eldar\\Desktop\\dir',
syscall: 'mkdir' }

```javascript
var fs = require('fs');

var i;
try {
for (var i = 0; i < 1000; i++) {
fs.mkdirSync('dir');
fs.rmdirSync('dir');
}
}
catch (e) {
console.log(i);
console.log(e);
}
```
node -v
v0.6.6

OS: win7