Tech
Half-written files and fs.watch on Windows: what I measured, and why rename fixes it
A lot of small desktop tools talk to other programs through a drop folder: the writer puts a JSON file in a directory, and the app watches the directory with fs.watch . It is simple and needs no ports or sockets. It also has a trap: the watcher can see the file before the writer has finished writing it.
I wanted to know how real that trap is on Windows, so I measured it instead of guessing. Everything below was run on Windows 11 with Node 24. I did not benchmark speed, only which events arri...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to