-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Open
Description
Version
25
Platform
Darwin
Subsystem
fs
What steps will reproduce the bug?
fs.writeFileSync("foo", "");
fs.globSync("foo/bar");How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
Expected:
fs.writeFileSync("foo", "");
fs.globSync("foo/bar").length == 0;Because:
fs.writeFileSync("foo", "");
await new Promise(r => fs.glob("foo/bar", e => e ?? r());
fs.unlinkSync("foo");
fs.globSync("foo/bar").length == 0;What do you see instead?
Uncaught:
Error: ENOTDIR: not a directory, lstat '/tmp/foo/bar'
at lstatSync (node:fs:1677:25)
at getDirentSync (node:internal/fs/glob:68:16)
at Cache.statSync (node:internal/fs/glob:134:17)
at #addSubpatterns (node:internal/fs/glob:395:32)
at Glob.globSync (node:internal/fs/glob:312:29)
at Object.globSync (node:fs:3200:37) {
errno: -20,
code: 'ENOTDIR',
syscall: 'lstat',
path: '/tmp/foo/bar'
}Additional information
Edit: reduced code.
Han5991
Metadata
Metadata
Assignees
Labels
No labels