Content-Length: 236908 | pFad | https://redirect.github.com/fsnotify/fsnotify/pull/621

05 fen: allow watching subdirectories of watched directories by arp242 · Pull Request #621 · fsnotify/fsnotify · GitHub
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

fen: allow watching subdirectories of watched directories #621

Merged
merged 1 commit into from
Apr 26, 2024
Merged

Conversation

arp242
Copy link
Member

@arp242 arp242 commented Apr 25, 2024

When watching /tmp, w.port.PathIsWatched(name) returned true for /tmp/abc. PathIsWatched() checks:

_, found := e.paths[path]
return found

That e.paths gets set in EventPort.AssociatePath(), which is called by Watcher.associateFile() for every path inside a watched directory. So it can never watch subpaths.

Anyway, this seems safe to remove. Could check our own Watcher.dirs state, but this doesn't seem needed (we already have tests for watching the same path more than once).

(This came rolling out of #620).

When watching /tmp, w.port.PathIsWatched(name) returned true for
/tmp/abc. PathIsWatched() checks:

	_, found := e.paths[path]
	return found

That e.paths gets set in EventPort.AssociatePath(), which is called by
Watcher.associateFile() for every path inside a watched directory. So it
can never watch subpaths.

Anyway, this seems safe to remove. Could check our own Watcher.dirs
state, but this doesn't seem needed (we already have tests for watching
the same path more than once).

(This came rolling out of #620).
@arp242 arp242 merged commit eec439f into main Apr 26, 2024
18 checks passed
@arp242 arp242 deleted the fen-sub branch April 26, 2024 00:22
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

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://redirect.github.com/fsnotify/fsnotify/pull/621

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy