4 ms·
I wonder if Explorer is deliberately updating the display after a timeout to handle the scenario where many files might rename in short succession. One simple
by exikyut 5y ago
I wonder if Explorer is deliberately updating the display after a timeout to handle the scenario where many files might rename in short succession.
One simple way to handle this could be to compute the timer to fire at $last_rename_time + $delay, initialize $last_rename_time to 0 (and later set it to the current time in milliseconds), then only actually start the timer if the calculated value is actually in the future (which it won't be for the first run).
Of course... Explorer might (...still) be using periodic polling. xD
You might be able to use Event Tracing for Windows to find out if Explorer is actually following events in real time, with the minor caveat that it might be a bit of a project. I gathered a small handful of ETW-related links over at https://news.ycombinator.com/item?id=28348564 https://news.ycombinator.com/item?id=28348564 a little while back FWIW.
- aallen90 5y agoI believe this is what's happening. I read something recently from Raymond Chen that it works like: 1. Open file with the delete flag 2. Call a function to set the new file information 3. Close the handle. The signal that a file was renamed happens in step 2, and that signal/event is what many applications subscribe to. Explorer will wait until the rename is fully completed with the handle closed before showing the change.