gow icon indicating copy to clipboard operation
gow copied to clipboard

fsnotify/fsnotify version

Open vanodevium opened this issue 2 years ago • 3 comments

This is example of gow based on fsnotify/fsnotify

Main goals:

  • it works even if in cwd() are "permission denied" folders
  • it automatically ignores hidden folders (like .git, .idea) ...

We can implement any goal :)

vanodevium avatar May 13 '22 10:05 vanodevium

Thank you for the various suggestions! I'm busy for IRL reasons, so please don't expect a meaningful response this week. Will try to dive in next week. 🙂

mitranim avatar May 13 '22 10:05 mitranim

Apologies but I decided that the old code was incompatible with collaborative work. I rewrote gow to make it more modular and maintainable. In addition, there is an internal interface Watcher that allows multiple watch implementations. If you're still interested, it's possible to add a watcher based on fsnotify and make it an option via CLI flags, instead of completely replacing notify.

Additionally, I'm not convinced that fsnotify is relevant. Your PR walks the existing directory structure, snapshotting it on startup, and watches directories and sub-directories. The exact same approach can be used with notify, without swapping to an inefficient polling-based library. This approach should also be opt-in, because it requires a fixed directory structure and may not work with dynamic adding and removal of directories. When "normal" recursive watch fails, we could annotate the error with a hint, suggesting the other approach to the user.

mitranim avatar May 28 '22 17:05 mitranim

Sounds good. I wanna help with your idea for modular gow :)

Lets gow be more elastic :)

vanodevium avatar May 28 '22 18:05 vanodevium