Skip to content

fs.fstat(0) fails on Windows #40006

@targos

Description

@targos

Version

master,v16.8.0

Platform

Microsoft Windows NT 10.0.22000.0 x64 (latest Windows 11 beta)

Subsystem

fs

What steps will reproduce the bug?

Run node test/parallel/test-fs-stat.js

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

Always

What is the expected behavior?

Test should pass

What do you see instead?

node test/parallel/test-fs-stat.js
node:assert:986
throw newErr;
^

AssertionError [ERR_ASSERTION]: ifError got unwanted exception: EISDIR: illegal operation on a directory, fstat
    at D:\Git\nodejs\node\test\common\index.js:364:12
    at D:\Git\nodejs\node\test\common\index.js:401:15
    at FSReqCallback.oncomplete (node:fs:198:21)
 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: [Error: EISDIR: illegal operation on a directory, fstat] {
    errno: -4068,
    code: 'EISDIR',
    syscall: 'fstat'
  },
  expected: null,
  operator: 'ifError'
}

Additional information

Fails here:

fs.fstat(-0, common.mustSucceed());

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to the fs subsystem / file system.testIssues and PRs related to the tests.windowsIssues and PRs related to the Windows platform.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions