-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readdirSync cannot read files properly when using { recursive: true, withFileTypes: true } #51773
Labels
fs
Issues and PRs related to the fs subsystem / file system.
Comments
Can reproduce in 18.17.1 but not in 18.19.0: $ nvm run 18.17.1
Running node v18.17.1 (npm v9.6.7)
Welcome to Node.js v18.17.1.
Type ".help" for more information.
> const fs = require('fs');
undefined
> fs.readdirSync('test', {recursive: true, withFileTypes: true});
[
Dirent { name: 'include', path: 'test', [Symbol(type)]: 2 },
Dirent { name: 'libvips-cpp.so.42', path: 'test', [Symbol(type)]: 1 },
Dirent {
name: undefined,
path: 'test/include',
[Symbol(type)]: undefined
},
Dirent {
name: undefined,
path: 'test/include',
[Symbol(type)]: undefined
}
]
> $ nvm run 18.19.0
Running node v18.19.0 (npm v10.2.3)
Welcome to Node.js v18.19.0.
Type ".help" for more information.
> const fs = require('fs');
undefined
> fs.readdirSync('test', {recursive: true, withFileTypes: true});
[
Dirent { name: 'include', path: 'test', [Symbol(type)]: 2 },
Dirent { name: 'libvips-cpp.so.42', path: 'test', [Symbol(type)]: 1 }
]
> |
Try the async approach:
|
avivkeller
added
the
fs
Issues and PRs related to the fs subsystem / file system.
label
Apr 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
v18.17.1
Platform
No response
Subsystem
fs
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: