I like the inotify subsystem in Linux. However, I'm mainly a Windows user, so I was wondering if there's anything similar?
I did a bit of searching, I seem to recall seeing something similar for Windows. There's FileSystemWatcher for .NET. Its mainly for NT or XP and forward.
See the FindFirstChangeNotification API, or the .NET counterpart FileSystemWatcher
http://jnotify.sourceforge.net/
or
this one from MS:
FileMon
Regards
Eugene
If you're using .net, use FileSystemWatcher. More info here: http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx
If you're using C, use FindFirstChangeNotification, FindNextChangeNotification, ReadDirectoryChangesW. More info here: http://msdn.microsoft.com/en-us/library/aa365261(VS.85).aspx
On OSX, the relevant api is the fsevents api.
They're all subtly different from one another, and they all have questionable reliability in edge cases. In general, you can't depend on these apis for a complete view of all changes 100% of the time. Most people using file system monitoring combine it with periodic scans to compensate for lost or incomplete information from the push api.