I have been searching the web for good ideas on creating an application. service, or vb script that will constantly monitor a file for changes. However, I want it to alert me when there are NO changes. The file I am monitoring is a log created by a very important application. If that file stops growing then that means there is something wrong with the application and it has stopped writing to the log file.
Does anyone have any ideas? I have played around with the FileSystemWatcher class in C# but I don’t know if there is a way to use to alert when a file does not change since all of the events look at changes.
Thank you.
Just use a timer that fires on an interval that that file should be updated in.
Check the file size (
FileInfo.Length) and if it is the same as the last time the timer fired, it is not growing.