Closed

Description
The function readdirSync returns folder that was already deleted.
steps to reproduce:
- create empty app/view folders and go to the view folder in Windows Explorer or file manager
- run the following script:
var fs = require('fs');
var res = [];
res.push(fs.readdirSync('app/')); // read subfolders - returns ['view'] array
res.push(fs.rmdirSync('app/view/')); // remove 'view' folder
res.push(fs.readdirSync('app/')); // read subfolders - returns ['view'] array instead of empty one
console.log(res);
expected result:
[ [ 'view' ], undefined, [] ]
actual result:
[ [ 'view' ], undefined, [ 'view' ] ]