Vote count:
0
Here is the code:
require 'rb-inotify'
notifier = INotify::Notifier.new
notifier.watch("/path/to/folder", :moved_to, :create, :attrib, :modify) do |event|
puts "I found #{event.name}!"
end
notifier.run
The folder is a symlink to another folder. I want to know when that symlink changes. For example I have /path/to/folder -> /link1 and when it changes to /path/to/folder -> /link2 I need to be able to tell. Is this possible using inotify or the ruby wrapper rb-inotify? Is there a better way of doing this?
asked 2 mins ago
Aucun commentaire:
Enregistrer un commentaire