Index | Files

package file

import ""

Package file uses the fsnotify library to watch for changes to files.


Package Files


type Watcher Uses

type Watcher struct {
    Updates <-chan struct{}
    Errors  <-chan error
    // contains filtered or unexported fields

Watcher watches for changes to a single named file or directory. It notifies the Updates chan on any changes to the watched file, while also handling parts of the path hierarchy to the file being removed and recreated.

func Watch Uses

func Watch(filename string) *Watcher

Watch creates a new file watcher for the given filename.

func (*Watcher) Unsubscribe Uses

func (w *Watcher) Unsubscribe()

Unsubscribe stops listening for updates and frees any resources used.

Package file imports 7 packages (graph) and is imported by 1 packages. Updated 2019-01-13. Refresh now. Tools for package owners.