// Start initialize watcher notifier and check for the notifier
// Event channel and Errors channel.
Start initialize watcher notifier and check for the notifier
Event channel and Errors channel.
// Start initialize watcher notifier and check for the notifier // Event channel and Errors channel .
func (w *Watcher) Start(vt *vtree.VTree) {
	for {
		select {
		case e := <-w.Notifier.Events:
			if !validEvent(e) {
				continue
			}
			switch e.Op {
			case fsnotify.Create:
				createHandler(w, vt, e.Name)
			case fsnotify.Write:
				writeHandler(w, vt, e.Name)
			case fsnotify.Remove: 
				removeHandler(w, vt, e.Name)
			default:
				log.WithField("event", e.String()).Warn("Watcher unhandled event")
				continue
			}
		case err := <-w.Notifier.Errors:
			sys.Alert(err.Error())
		case <-w.Done:
			return
		}
	}
}
func ( w * Watcher ) Start ( vt * vtree . VTree ) { for { select { case e := <- w . Notifier . Events : if ! validEvent ( e ) { continue } switch e . Op { case fsnotify . Create : createHandler ( w , vt , e . Name ) case fsnotify . Write : writeHandler ( w , vt , e . Name ) case fsnotify . Remove : removeHandler ( w , vt , e . Name ) default : log . WithField ( " " , e . String ( ) ) . Warn ( " " ) continue } case err := <- w . Notifier . Errors : sys . Alert ( err . Error ( ) ) case <- w . Done : return } } }
Start initialize watcher notifier and check for the notifier
Event channel and Errors channel.
Start initialize watcher notifier and check for the notifier Event channel and Errors channel .
// manually remove from folder triggers fsnotify.Rename