Skip to content

rmDir ENOENT: no such file or directory after successful deletion of the folder #29279

Closed

Description

@talaikis
  • Version: 12.8.1
  • Platform: Windows 10 x64 1903
  • Subsystem: -

The following code returns an error AFTER SUCCESSFUL deletion of the folder:

[Error: ENOENT: no such file or directory, scandir '...'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '....'
}
stat(path, (err, _) => {
  if (!err) {
    rmdir(path, (err) => {
      if (err === null) { <<< returns null here and then throws error making this function worthless
        done(false)
      } else {
        done('Error')
      }
    })
  } else {
    done(false)
  }
})

Activity

  1. changed the title [-]rmDir ENOENT: no such file or directory[/-] [+]rmDir ENOENT: no such file or directory after successful deletion of the folder[/+] on Aug 23, 2019
  2. talaikis commented on Aug 23, 2019

    @talaikis
    Author

    Figured that out.

  3. greend29 commented on Jan 15, 2022

    @greend29
  4. greend29 commented on Jan 15, 2022

    @greend29
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions