Open dneuschaefer-rube opened 3 years ago
I think it would certainly be possible. The logic would be relatively simple except that I'm not quite sure how to configure non-recursive watching for macOS, so maybe we'll just have to filter events that are in a subdirectory.
I'm definitely open to adding the feature. Are you interested in attempting a fix?
I think it would be a nice addition to allow watching a directory non-recursively.
Currently, when registering a
Path
with the builder, the watcher is either set up with theFILE_TREE
modifier or recursively for all descendant directories, depending on system capabilities. I circumvent this by instantiating the watcher with an empty path list, then initializingpaths
andpathHashes
with a single path and hashes for all files, and then callingregister(path, false)
, all using reflection. This does what I want, but needless to say, that's not great practice ;)Thanks for the great library!