Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to Node.js documentation.fsIssues and PRs related to file-system APIs and the fs module.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