-
Notifications
You must be signed in to change notification settings - Fork 250
Closed
Labels
Description
TL; DR - UPDATE: this feature doesn't make sense due to technical limitations of the adapters.
Listen currently watches every file in a watched directory and applies the filter after receiving system events.
On optimized backends, this causes lots of unnecessary calls through Ruby upon every file change.
(e.g. changes in db/test.sqlite trigger changes through Listen)
How to implement (minimal work)
- disable recursion on all optimized adapters: windows.rb (see wdm), darwin.rb (see: rb-fsevent) [note, "disabling" here means ignoring reported subdirs], linux.rb (see: rb-inotify))
- get listen working again by implementing the recursion in Ruby in the base adapter (rb-inotify has a great Ruby implementation of recursion)
- get the adapter to turn a watched directory into an array of directories to watch non-recursively here
- Finally, translate physical paths backs into symlink paths (if they exist) here: https://github.com/guard/listen/blob/master/lib/listen/adapter/base.rb#L47