I like the inotify subsystem in Linux. However, I'm mainly a Windows user, so I was wondering if there's anything similar?
Join them; it only takes a minute:
closed as off-topic by Yu Hao, Martijn Pieters♦ Dec 20 '15 at 19:34This question appears to be off-topic. The users who voted to close gave this specific reason:
|
|||
|
|
|||
|
See the FindFirstChangeNotification API, or the .NET counterpart FileSystemWatcher |
|||
|
|
|
If you're using .net, use If you're using C, use On OSX, the relevant api is the 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. |
|||||||||||||||||
|
|
take a look at this: inotify-win, a port of the inotifywait tool for Windows and also this: inotify-tools |
|||
|
|
|
|
|||||||||
|
|
A bit late but ... Windows has a facility similar to OSX events whereby you can monitor events without running an app. The Windows USN Journal keeps track of all file changes. Jeffrey Richter (author of Advanced Windows) wrote a terrific article with working samples for MSDN Journal. MSDN documentation for USN Change Journals. USN Change Journals are probably better if you're building applications like backup tools or indexes that need to monitor entire volumes. |
|||||||||
|
|
FileSystemWatcher() is unreliable mainly due to the fact it's error handling for the watcher buffer is more or less incomplete. Due to a lack of path and detailed error handling information, Microsoft gives you no way to recover or manually poll the working directory. The JNotify for Windows is unreliable as well because this bug ^ derives from win32. JNotify uses win32. So, it's no different than FileSystemWatcher(). |
|||||||||||||
|
|
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. |
|||
|
|