Closed
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 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.