Skip to content

A wrapper for fsnotify that automatically recursively watches directory

License

Notifications You must be signed in to change notification settings

dasbd72/rfsnotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rfsnotify

A wrapper of golang fsnotify that automatically recursively watches directory

Usage

package main

import (
	"log"

	"github.com/dasbd72/rfsnotify"
)

func main() {
    watcher, err := rfsnotify.NewWatcher()
	if err != nil {
		log.Fatal(err)
	}
	err = watcher.Add(root_dir)
	if err != nil {
		log.Fatal(err)
	}

    for {
		select {
		case ev := <-watcher.Events:
			log.Println("event:", ev)
		case err := <-watcher.Errors:
			log.Println("error:", err)
		}
		log.Println(watcher.WatchList())
	}
}

About

A wrapper for fsnotify that automatically recursively watches directory

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages