I have a text file that several instances of the same app use to synchronize and exchange data between themselves. In a nutshell it's a plain text file that contains list of data files. These data files come and go on a regular basis.
Is there a reliable way to know that some app wrote to the file since it was last read from? Normally you would use Modified date for it. However the file is accessed so frequently that it will likely be constantly present in memory cache. So there is a flight chance that writing to the file will not alter Modification date.
Is there any other way to know that file was changed.
I know about file system notifications but would rather not use them here.
The software is in C# but obviously I can also use any WinAPI function via InteropServices. Software runs on Windows Server 2008 R2. File system is NTFS. Ideally the method should also work on network shares.