Skip to content

statSync with throwIfNoEntry: false still throws ENOTDIR #56993

@jdalton

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

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions