Skip to content

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).
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.

3 participants