Reputation: 43
Is there an efficient way to monitor all the files in a directory and determine when they are modified? I'm trying to avoid polling the directory every couple of seconds and running:
File.GetLastAccessTime(string path);
Upvotes: 1
Views: 537
Reputation: 3380
That's what the FileSystemWatcher
class is all about.
http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx
Good luck
Upvotes: 2