Skip to content

Feature request: Listen could *really ignore* ignored directories (optimization) #274

@e2

Description

@e2

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)

  1. 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))
  2. get listen working again by implementing the recursion in Ruby in the base adapter (rb-inotify has a great Ruby implementation of recursion)
  3. get the adapter to turn a watched directory into an array of directories to watch non-recursively here
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions