Skip to content

dimfeld/treewatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

treewatcher Build Status GoDoc

Recursive Filesystem Tree Watcher for Go

This is a wrapper around the fsnotify functionality from howeyc/fsnotify.

It exposes a similar interface, with an Event channel and an Error channel. All data read from the fsnotify object is passed through to the client.

When the TreeWatcher sees that a directory was added, it automatically starts watching that directory and all directories under it.

Usage

tw = treewatcher.New()
defer tw.Close()
tw.WatchTree("/tmp")

for {
    select {
    event := <- tw.Event:
        handleEvent(event)
    error := <- tw.Error:
        panic(error)
    }
}

For a real usage example, see dimfeld/simpleblog/fswatcher.go.

About

Recursive Filesystem Tree Watcher for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages