filesystemwatcher file access

  • Thread starter Thread starter Lars Nielsen
  • Start date Start date
L

Lars Nielsen

Hi
Is it possible to add more events to the FileSystemWatcher object than the
standard create, change, delete and rename? I want to use it to watch if
anyone opens or accesses a file?

regards
Lars Nielsen
 
Hello

Add NotifyFilters.LastAccess flag to NotifyFilter property for
FileSystemWatcher. I think this is what you want.

Best regards
Sherif
 
Hi Lars,

IIRC if you open a file the last access time will change, if so you can use
the Changed event of the FileSystemWatcher to detect it, if so you can use
FileSystemEventArgs.ChangeType track it, What I don't know for sure is if
you can filter an open operation from the rest of the changes detected.


Cheers,
 
Back
Top