Skip to content

readdirSync returns deleted folder #4760

Closed
@ghost

Description

The function readdirSync returns folder that was already deleted.

steps to reproduce:

  1. create empty app/view folders and go to the view folder in Windows Explorer or file manager
  2. 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' ] ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to the fs subsystem / file system.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions