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

GetPaths function to read out all watched paths. #440

Closed
chamabreu opened this issue Apr 7, 2022 · 4 comments
Closed

GetPaths function to read out all watched paths. #440

chamabreu opened this issue Apr 7, 2022 · 4 comments
Labels
need-feedback Requires feedback to be actionable

Comments

@chamabreu
Copy link

I need to get the paths, which are watched by the fsNotify.Watcher.
Because there is no .removeAll() function, I need to iterate over all watched Paths to then decide which Paths I want to remove.

A Solution like .getAllWatchedPaths() to get the Path map/array.

Target is, that I want to "Clear out" the Watcher, without closing and recreating it.
I need just One single Instance to work with, and want more possibilities to manipulate, like .removeAll() , .getAllPaths() , .addMultiplePaths() etc...

@arp242
Copy link
Member

arp242 commented Jul 21, 2022

What is your use case for this? If you added paths to a watcher, then it seems to me you already know which paths you're watching and can keep track of them for removal? Alternatively, you can close the watcher and create a new one to "clear" it (you mentioned you don't want to do that, but it's not clear to me why).

@arp242 arp242 added the need-feedback Requires feedback to be actionable label Jul 21, 2022
@arp242
Copy link
Member

arp242 commented Jul 21, 2022

Also: looks like there's an issue for this already: #93 So I'll close this as a duplicate of that one.

Still, it's important that people provide actual use cases. Otherwise it's not clear if a "list all watched paths" is even the best solution; maybe it is, or maybe there's a better solution to address the use case. So I would encourage you to still post it.

@arp242 arp242 closed this as completed Jul 21, 2022
@chamabreu
Copy link
Author

Yes.
My usecase was solved with #374

Thanks

@arp242
Copy link
Member

arp242 commented Jul 22, 2022

Oh right, I didn't realize that got added recently 🤦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-feedback Requires feedback to be actionable
Projects
None yet
Development

No branches or pull requests

2 participants