Skip to content

fs.mkdirSync with recursive: true throws ENOENT instead of ENOSPC when disk is full #42808

Description

@thynson

Version

16.14.1

Platform

Linux

Subsystem

No response

What steps will reproduce the bug?

No response

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

Same as fs.mkdirSync without options:

> fs.mkdirSync('./a')
Uncaught Error: ENOSPC: no space left on device, mkdir './a'
    at Object.mkdirSync (node:fs:1336:3) {
  errno: -28,
  syscall: 'mkdir',
  code: 'ENOSPC',
  path: './a'
}

What do you see instead?

> fs.mkdirSync('./a', {recursive: true})
Uncaught Error: ENOENT: no such file or directory, mkdir './a'
    at Object.mkdirSync (node:fs:1336:3) {
  errno: -2,
  syscall: 'mkdir',
  code: 'ENOENT',

Additional information

No response

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

    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