Skip to content

fs:fs.mkdir() the process does not exit when recursive is set to true in some case #28241

@changk99

Description

@changk99
  • Version: v10.15.0
  • Platform: win10
  • Subsystem: x64 win32
    create a new file and set the file name 'test'
    the index.js is same level
// index.js
const fs = require('fs')

fs.mkdir('./test', {
  recursive: true
}, (err) => {
  console.log(err) // [Error: EEXIST: file already exists]
})

this will trigger the error

const fs = require('fs')

fs.mkdir('./test/a', {
  recursive: true
}, (err) => {
  console.log(err) 
})

this will not trigger the error and the process does not exit

if test is a directory is no problem, but if test is a file and recursive is true, the process does not exit and keep waiting and not trigger error

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssues and PRs that are duplicates of other issues or PRs.fsIssues and PRs related to the fs subsystem / file system.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions