Skip to content

statSync with throwIfNoEntry: false still throws ENOTDIR #56993

Description

@jdalton

Version

at least Node 20+

Platform

osx

Subsystem

No response

What steps will reproduce the bug?

in your terminal of choice

touch a

then enter into node repl

fs.statSync('./a/b', { throwIfNoEntry: false }) // throws ENOTDIR error

How often does it reproduce? Is there a required condition?

a file exists in part of the path.

What is the expected behavior? Why is that the expected behavior?

I would expect undefined to be returned instead of erroring.

What do you see instead?

it throws a ENOTDIR error.

Additional information

No response

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

    fsIssues and PRs related to file-system APIs and the fs module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions