`fs.watch`: endless file events reported
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 122k
- Fork
- 37.3k
- Merge medio
- 4g 2h
- PR unite (30g)
- 283
Descrizione
Version
v22.21.1
Platform
Microsoft Windows NT 10.0.26200.0 x64
Subsystem
No response
What steps will reproduce the bug?
- create a folder
vscode - run this command in that folder
mkdir .vscode && echo {"editor.fontSize": 33}>.vscode\settings.json - run the following node.js script in a terminal pointing to the folder
vscode/.vscode - run this command in that folder
rmdir /s /q .vscode\ && mkdir .vscode && echo {"editor.fontSize": 33}>.vscode\settings.json
const 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");
}
});
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior? Why is that the expected behavior?
After running the last command there should be change events reported in an endless fashion.
What do you see instead?
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
Additional information
Originally reported in VS Code repo as https://github.com/microsoft/vscode/issues/287800
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con l’API fs.watch e riproduci la sequenza Windows usando lo script Node.js fornito. Confronta gli eventi di rinomina ripetuti e i valori dei percorsi con il comportamento atteso indicato, quindi traccia il percorso di monitoraggio dei file in Windows. Il lavoro è completo quando la riproduzione non produce più eventi infiniti involontari e il comportamento rilevante è coperto da un test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, node.js
- Ambito
- backend, operating-systems
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100