3 ms·
Like other people said, it is about refreshing the view for changes that didn't trigger an automatic refresh. If you dig the details, behind the scenes an API
by gusmd 11y ago
Like other people said, it is about refreshing the view for changes that didn't trigger an automatic refresh.
If you dig the details, behind the scenes an API called ReadDirectoryChangesW is called, which uses a notification-like system to report changes within a directory. However, that API is weird, so various types of changes are not correctly reported and explorer.exe is stuck with outdated data. The refresh forces it to update the view.
Disclaimer: I've had to use that API recently to code a simple python file monitor in Windows. https://github.com/gusmd/vigil.py https://github.com/gusmd/vigil.py in case anyone is interested.
- userbinator 11y agoFrom the documentation: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365465(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/aa3... If number of bytes transferred is zero, the buffer was too small to provide detailed information on all the changes that occurred in the directory or subtree. In this case, you should compute the changes by enumerating the directory or subtree. I suppose that's the case when Explorer gives up, because for this to work it would require keeping a copy of all the directory contents to compare with, and "enumerating" would be unacceptably slow.