ThomasMonkman / filewatch

File watcher in c++
MIT License
436 stars 73 forks source link

How to stop the file watcher? #30

Closed ZaWarudo111 closed 1 year ago

ZaWarudo111 commented 2 years ago

I want to stop watching a directory, for example i am watching C:\test\someFolder, and i want to stop watching it and start watching C:\another\test

so how could I do it?

robiwano commented 2 years ago

Just delete the FileWatcher object, and create a new one?

ThomasMonkman commented 1 year ago

yes @ZaWarudo111, @robiwano is right, the library follow cpp raii pattern, construction of the class start, destruction ends, if you want fined grained control over this, create the object with an smart pointer.

of course I would probably accept a pr to allow changing a watched dir during object life time.