Skip to content

fen: allow watching subdirectories of watched directories#621

Merged
arp242 merged 1 commit intomainfrom
fen-sub
Apr 26, 2024
Merged

fen: allow watching subdirectories of watched directories#621
arp242 merged 1 commit intomainfrom
fen-sub

Conversation

@arp242
Copy link
Copy Markdown
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.

2 participants