guard / listen

The Listen gem listens to file modifications and notifies you about the changes.
https://rubygems.org/gems/listen
MIT License
1.91k stars 245 forks source link

Crash in rb-inotify if file is not accessible is not handled gracefully #557

Open sebbASF opened 2 years ago

sebbASF commented 2 years ago

I tried watching a directory on Ubuntu (20.04). This has a link to a directory containing some files which are not accessible to the logged in user.

When such a file is encountered, listen crashes (see sample below). it would be better if it reported the issue and carried on - or at least provide the option to do so.

23: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/listener.rb:92:in `start'
22: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/fsm.rb:72:in `transition'
21: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/fsm.rb:105:in `transition_with_callbacks!'
20: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/fsm.rb:124:in `call'
19: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/fsm.rb:124:in `instance_eval'
18: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/listener.rb:71:in `block in <class:Listener>'
17: from /usr/lib/ruby/2.7.0/forwardable.rb:235:in `start'
16: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/adapter/base.rb:66:in `start'
15: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/adapter/base.rb:42:in `configure'
14: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/adapter/base.rb:42:in `each'
13: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/adapter/base.rb:47:in `block in configure'
12: from /var/lib/gems/2.7.0/gems/listen-3.7.1/lib/listen/adapter/linux.rb:30:in `_configure'
11: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:202:in `watch'
10: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:202:in `each'
 9: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:210:in `block in watch'
 8: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:202:in `watch'
 7: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:202:in `each'
 6: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:210:in `block in watch'
 5: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:202:in `watch'
 4: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:202:in `each'
 3: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:210:in `block in watch'
 2: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:200:in `watch'
 1: from /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:200:in `new'

/var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:200:in `initialize': Permission denied @ dir_initialize - path/to/file (Errno::EACCES)