Skip to content

fs.statSync does not throw an error when accessing non-existent directory on Windows 10 #9106

Closed
@balos1

Description

@balos1
  • Version: v6.7.0
  • Platform: Windows 10 (64 bit)
  • Subsystem: fs

On Windows 10, I am not getting the same behavior of fs.statSync when trying to access a non-existent directory as I do on Linux. The expected result is for an error to be thrown, which occurs on Linux, but not on Windows 10.

Example:

try {
    var stat = fs.statSync(path_to_missing_dir);
    if (stat.isDirectory()) return true;
} catch (err) { 
    console.log(err.message);  // not reached on windows 10
}

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