Skip to content

Disable recursion under Linux #556

Open

Description

@sebbASF

Does not seem possible to disable recursion under Linux.
It should be possible to watch a single directory, without any subdirectories.

Activity

  1. ColinDKelley commented on Nov 29, 2022

    @ColinDKelley
    Collaborator

    @sebbASF I don't think this is a feature of the underlying drivers like fs-event, is it?

    It's not too hard to skip over the changes you don't want in the callbacks, is it?

  2. sebbASF commented on Nov 29, 2022

    @sebbASF
    Author

    It may not be hard, but why not allow this to be optionally done by the library?

  3. ColinDKelley commented on Nov 29, 2022

    @ColinDKelley
    Collaborator

    but why not allow this to be optionally done by the library?

    I was thinking to keep this gem uncomplicated. But if you want to propose an interface that allows that, please throw a proposal together.

    Also, just to confirm, it sounds like you agree that this isn't a feature of the underlying drivers like fs-event?

  4. sebbASF commented on Nov 30, 2022

    @sebbASF
    Author

    AIUI under Linux, the gem uses inotify via rb-inotify.
    Now inotify does not support recursion directly, so rb-inotify emulates this if the :recursive flag is provided.
    By default it looks like listen includes the :recursive flag when configuring rb-inotify.

    The problem is that it does not appear to be possible to disable this setting.

  5. sebbASF commented on Dec 1, 2022

    @sebbASF
    Author

    This is important because each additional directory monitored by inotify takes up system resources.
    So although events can be filtered out later, for large directory trees there can be significant overhead.

  6. ColinDKelley commented on Jan 13, 2023

    @ColinDKelley
    Collaborator

    Now inotify does not support recursion directly, so rb-inotify emulates this if the :recursive flag is provided.
    By default it looks like listen includes the :recursive flag when configuring rb-inotify.

    Ok, that sounds like a good reason to allow recursion to be disabled. If we support that, we'll need to disable it on the other drivers too. How difficult does that seem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions