 <p>There are wrappers to inotify that make it easy to use from high-level languages. For example, in ruby you can do the following with <a href="http://github.com/nex3/rb-inotify" rel="nofollow">rb-inotify</a>:</p> <pre><code>notifier = INotify::Notifier.new # tell it what to watch notifier.watch("path/to/foo.txt", :modify) {puts "foo.txt was modified!"} notifier.watch("path/to/bar", :moved_to, :create) do |event| puts "#{event.name} is now in path/to/bar!" end </code></pre> <p>There's also <a href="http://pyinotify.sourceforge.net/" rel="nofollow">pyinotify</a> but I was unable to come up with an example as concise as the above.</p>