Watch directories to catch delete/move swap patterns as well as direct
# modifications. This handles, e.g. :w in vim.
dirs.each do |dir|
@notifier.watch( dir, :all_events ) do |event|
if event.flags.include? :modify and
files.include? event.absolute_name
handle_file_event( event )
end
end
end
Watch directories to catch delete/move swap patterns as well as direct
# modifications. This handles, e.g. :w in vim.
dirs.each do |dir|
@notifier.watch( dir, :all_events ) do |event|
if event.flags.include? :modify and
files.include? event.absolute_name
handle_file_event( event )
elsif event.flags.include? :moved_to and
files.include? event.absolute_name
handle_file_event( event )
end
end
end
Editing a file with gedit didn't trigger notifications. Since each file_change with gedit triggers a "moved_to" event, I changed the
def setup_inotify @notifier = INotify::Notifier.new files = self.find_files.keys dirs = files.map{|f| File.dirname( f )}.uniq
Watch directories to catch delete/move swap patterns as well as direct
end
to the following code
def setup_inotify @notifier = INotify::Notifier.new files = self.find_files.keys dirs = files.map{|f| File.dirname( f )}.uniq
Watch directories to catch delete/move swap patterns as well as direct
end