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

On FreeBSD notifications are only delivered using RecursiveMode::Recursive #577

Closed
GyulyVGC opened this issue Mar 20, 2024 · 1 comment
Closed

Comments

@GyulyVGC
Copy link

System details

  • OS/Platform name and version: FreeBSD 13.2
  • Rust version (if building from source): 1.74.1
  • Notify version (or commit hash if building from git): 6.1.1

What you did (as detailed as you can)

I was watching in NonRecursive mode a directory containing a single file.

What you expected

I expected to get notifications on file changes.

What happened

No notifications were delivered.
I fixed the issue by setting RecursiveMode::Recursive, even if the folder just contain a simple file (no nested folders).
This only happens on FreeBSD... maybe a problem with kqueue?

@squidfunk
Copy link

squidfunk commented Jan 3, 2025

This is how kqueue works – it requires to open an FD for every watched file. Thus, I believe it's not the fault of this crate but rather a limitation of kqueue. For reference, see this paragraph in the README of Go's fsnotify:

kqueue requires opening a file descriptor for every file that's being watched; so if you're watching a directory with five files then that's six file descriptors. You will run in to your system's "max open files" limit faster on these platforms.

This explains why recursive is necessary, as all files in a directory need to be watched explicitly.

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

No branches or pull requests

3 participants