Issue involves complex file system behavior on Windows with potential libuv dependency.
The issue describes endless file events reported by `fs.watch` on Windows when a directory is deleted and recreated. The root cause may involve libuv or Windows-specific behavior. The problem is reproducible but requires deeper investigation into the interaction between Node.js, libuv, and Windows file system APIs.
v22.21.1
Microsoft Windows NT 10.0.26200.0 x64
No response
vscodemkdir .vscode && echo {"editor.fontSize": 33}>.vscode\settings.jsonvscode/.vscodermdir /s /q .vscode\ && mkdir .vscode && echo {"editor.fontSize": 33}>.vscode\settings.jsonconst fs = require("fs");
fs.watch("<path to a folder>/.vscode", (eventType, filename) => {
if (filename) {
console.log(`Event Type: ${eventType}`);
console.log(`Filename: ${filename}`);
} else {
console.log("Filename not provided");
}
});
Always.
After running the last command there should be change events reported in an endless fashion.
Endless reports of:
Filename: \\?\C:\Users\bpasero\Desktop\testing-watcher\.vscode
Event Type: rename
Filename: \\?\C:\Users\bpasero\Desktop\testing-watcher\.vscode
Event Type: rename
Filename: \\?\C:\Users\bpasero\Desktop\testing-watcher\.vscode
Event Type: rename
Filename: \\?\C:\Users\bpasero\Desktop\testing-watcher\.vscode
Event Type: rename
Originally reported in VS Code repo as https://github.com/microsoft/vscode/issues/287800
Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!