Browse files

Merge remote branch 'hron/fix-guard-crash-when-file-is-deleted-very-f…

…ast'

Closes gh-14
Closes gh-13
  • Loading branch information...
2 parents 5d44eac + 4fe776f commit e2d9089953382480aac59e9c0eb4f2be24a6dc09 @nex3 committed Aug 2, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/rb-inotify/notifier.rb
View
6 lib/rb-inotify/notifier.rb
@@ -198,7 +198,11 @@ def watch(path, *flags, &callback)
return watch(path, *((flags - [:recursive]) | rec_flags)) do |event|
callback.call(event) if flags.include?(:all_events) || !(flags & event.flags).empty?
next if (rec_flags & event.flags).empty? || !event.flags.include?(:isdir)
- watch(event.absolute_name, *flags, &callback)
+ begin
+ watch(event.absolute_name, *flags, &callback)
+ rescue Errno::ENOENT
+ # If the file has been deleted since the glob was run, we don't want to error out.
+ end
end
end

0 comments on commit e2d9089

Please sign in to comment.