andreaskoch / go-fswatch

fswatch is a go library for monitoring filesystem changes that does not depend on inotify
Other
57 stars 9 forks source link

Does it support recurse? #4

Closed chennqqi closed 8 years ago

chennqqi commented 8 years ago

Does it support recurse?

andreaskoch commented 8 years ago

Yes, go-fswatch does allow recursive monitoring of folder structures. You can have a look at the fswatch.NewFolderWatcher(...) function. It has four arguments:

  1. folderPath: The folder you want to monitor for changes
  2. recurse: A flag indicating whether fswatch will recurse down the given folder path
  3. skipFile func: A function which you can use to skip certain files and folders (e.g. ".git")
  4. checkIntervalInSeconds: The check interval (e.g. 2 seconds)

see: https://github.com/andreaskoch/go-fswatch/blob/master/folder.go#L49