The parentPath
returned by fsPromises.glob
is incorrect in some cases.
#55060
Labels
confirmed-bug
Issues with confirmed bugs.
fs
Issues and PRs related to the fs subsystem / file system.
Version
v22.8.0
Platform
Subsystem
No response
What steps will reproduce the bug?
fsPromises.glob
has inconsistentparentPath
behavior when passedwithFileTypes
option.According to the documentation,
dirent.parentPath
should return path to the parent directory, but in some cases it doesn't.How often does it reproduce? Is there a required condition?
This occurs when a path is passed that does not contain a wildcard(
*
) in the filename portion.For example, passing
./path/*/file.txt
will result in different behavior than passing./path/to/*.txt
.What is the expected behavior? Why is that the expected behavior?
parentPath
contains the path to a file, not the path to a directory.What do you see instead?
The path to the file, not the path to the directory
Additional information
As far as I can see, something similar is happening with
fs.globSync
.The text was updated successfully, but these errors were encountered: