I'm using the FileSystemWatcher class to monitor a file for changes in size. The software that is writing to the file keeps a stream open and writes about every five seconds.
The changed
event is only firing when I have the Windows Explorer open and click "refresh" to force Windows to update the listed size of the file. (Windows 7 specifically.)
I know the FileSystemWatcher is kind of pokey, but are there any solutions here besides periodically polling the file with FileInfo? E.g. can I get Windows to update its file stats more frequently?
Note that the "ModifiedAt" time stamp is never updated after the writing software opens the handle to the file. Not sure if Windows uses updates to the ModifiedAt stamp to trigger re-calculating other file stats. I've tried all of the NotifyFilters and none are triggered without forcing Windows to update its file stats.
Relates to: At what times are files updated on windows