Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive directory monitoring -> inconsistent behavior #3

Open
jagreenwood opened this issue Apr 18, 2024 · 3 comments
Open

Recursive directory monitoring -> inconsistent behavior #3

jagreenwood opened this issue Apr 18, 2024 · 3 comments

Comments

@jagreenwood
Copy link
Contributor

When working with this library on macOS and Linux, I'm seeing a difference in behavior between the two regarding recursive monitoring of directories.

Given the scenarios:

  1. watch a directory, add a file to directory
  2. watch a directory with a subdirectory, add a file to subdirectory
  3. watch a directory, add a subdirectory, add a file
1 2 3
macOS
Linux

The reason for this difference is because the inotify C library does not automatically support recursion.

Inotify monitoring of directories is not recursive: to monitor subdirectories
under a directory, additional watches must be created. This can take a significant 
amount time for large directory trees.

I'm not sure which is behaving as intended for the scope of this project, but would expect the behavior to be the same.

@KrisSimon
Copy link
Contributor

Hi @jagreenwood
Thank you very much for raising this issue.

My favour would be a consistent behaviour in both (windows is still missing) worlds. Rarely you have to watch a full file tree, so I would go with mimic the linux way back to mac.

Would you like to open a fork and provide a pull request? <3

@jagreenwood
Copy link
Contributor Author

I actually feel like macOS's behavior is more flexible making it more desirable. While increasing complexity, perhaps an implementation that takes a set of option flags would be a good path forward?
I'm afraid I don't have the bandwidth atm to look at this, but I can put it my queue to revisit :)

@KrisSimon
Copy link
Contributor

It's on the roadmap!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants