-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.
Description
- Version: 10.10.0
- Platform:
- Subsystem: fs
While looking through the code of readDir
's new option withFileTypes
I noticed that getDirents
unconditionally calls the callback in case of an error:
Lines 133 to 136 in d994e26
if (err) { | |
callback(err); | |
return; | |
} |
If more than one file is of type UV_DIRENT_UNKNOWN
and fs.stat
returns with an error for more than one of these files, the callback will be called more than once. That could lead to unexpected behavior for API users.
I don't know if that needs to be fixed as the scenario seems very unlikely, but I thought I should at least report it.
Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.