I am trying to look at files in a directory to determine when files are open / available. I thought FileSystemWatcher would do the trick using the Changed event.
The problem is that some applications do not create a lock on the file they open / access, or change either the modification date or the access date (even after fsutil behavior set disablelastaccess 0 ). For example, Notepad. Apparently, he makes a copy of the file in memory and plays with it there until you save it. Also, it does not update the access date.
How to control the file directory and receive notifications that the file simply opens or is opened by some program (for example, Notepad)? Files can be opened from another computer, not necessarily launching an โobserverโ on the computer.
I found many similar questions, but did not see anyone focusing on file access.
Kez
source share