Skip to content

Behavior of realpath with an empty string argument #53635

Description

@avivkeller

Refs: #35403

Currently, the project has 2 outcomes for different realpath functions with empty string arguments:

fs.realpathSync('') // Returns CWD
await util.promisify(fs.realpath)('') // Returns CWD

await fs.promises.realpath('') // ENOENT Error
fs.realpathSync.native('') // ENOENT Error
await util.promisify(fs.realpath.native)('') // ENOENT Error

IMO, this should be standardized to
(A) Always throw
(B) Always return CWD
(C) Return CWD for non-.native calls, throw otherwise

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

    discussIssues opened for discussion and feedback.fsIssues and PRs related to file-system APIs and the fs module.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions