Skip to content

fs.existsSync returns wrong value on windows if there are no permissions on the given file #17921

Closed
@ghost

Description

  • Version: v9.2.0
  • Platform: windows 8.1
  • Subsystem: fs

Steps to reproduce the issue

  1. Create a file (for example 1.txt)
  2. Disable permissions inheritance and remove all inherited permissions from the file
  3. Execute fs.existsSync('1.txt')

What is the expected behavior

The file exists (and it is also listed if you readdirSync it's parent directory), so the return value should be true.

What went wrong

The return value is false, like the file doesn't exist. If it is working as intended, then consider this issue as a feature request. However, if you're not aware of this behavior, then I'm pretty sure it is a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.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