Skip to content

fs.rmdir on Windows throws ENOENT instead of ENOTDIR #18014

Description

@saschanaz
  • Version: v9.3.0
  • Platform: Windows 10
  • Subsystem:
> fs.statSync("emmake")
Stats {
  dev: 3066473769,
  mode: 33206,
  nlink: 1,
  uid: 0,
  gid: 0,
  rdev: 0,
  blksize: undefined,
  ino: 105271641289789120,
  size: 548,
  blocks: undefined,
  atimeMs: 1515062172219.6804,
  mtimeMs: 1515062172220.681,
  ctimeMs: 1515062172220.681,
  birthtimeMs: 1496261901857.4617,
  atime: 2018-01-04T10:36:12.220Z,
  mtime: 2018-01-04T10:36:12.221Z,
  ctime: 2018-01-04T10:36:12.221Z,
  birthtime: 2017-05-31T20:18:21.857Z }
> fs.rmdirSync("emmake")
Error: ENOENT: no such file or directory, rmdir 'C:\Users\sasch\Documents\GitHub\emsdk\emscripten\incoming\emmake'
    at Object.fs.rmdirSync (fs.js:866:18)

It should throw ENOTDIR instead of ENOENT as there is an entry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    errorsIssues and PRs related to JavaScript errors originating in Node.js core.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