Repository navigation
[v18.x] Wrong path returned by fs.readdir withFileTypes=true #52441
Description
Activity
cc @aduh95
hi guys, what's the status of this issue? I can look into it if it wasn't assigned to anyone yet
@gm-al Basically waiting for a PR, feel free to work on it if you want :) You can ping me when you had something to review
Just had a quick scan, looks like the current main does not have path property any more? was that intentional? (it was still there in v20.x, v22.x and I couldn't see it mentioned in the changelog or docs
Hello! May I try to resolve this issue?
The dirent.path field has been deprecated in #51020 and removed in #55548 (like @jakecastelli mentioned above)
Precisely for reasons like the one presented here I assume
So this issue is no longer applicable and should be closed
cc. @aduh95
@dario-piotrowicz Thanks for the reminder, closing since this is no longer applicable.
Version
18.20.1
Platform
Linux h4ad 6.5.0-27-generic #28~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 15 10:51:06 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
fs/promise
What steps will reproduce the bug?
You can reproduce the issue by running the following commands:
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
The path should be
..What do you see instead?
The path is different:
This issue only happens on
fs/promises, onreaddirSync, we don't see this issue:Also, if we include
recursive, we don't see the issue:Additional information
This bug was first introduced at
18.20.0, on18.19.1the behavior is correct.On latest version of node,
21.7.2and20.12.1, we don't see this issue.This bug was found by @wraithgar at npm/cli#7352 (comment)