diff --git a/fen.go b/fen.go index ced39cb8..1eb1ab37 100644 --- a/fen.go +++ b/fen.go @@ -31,7 +31,7 @@ func (w *Watcher) Add(name string) error { return nil } -// Remove stops watching the the named file or directory (non-recursively). +// Remove stops watching the named file or directory (non-recursively). func (w *Watcher) Remove(name string) error { return nil } diff --git a/fsnotify.go b/fsnotify.go index 89cab046..0ff31299 100644 --- a/fsnotify.go +++ b/fsnotify.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !plan9 - // Package fsnotify provides a platform-independent interface for file system notifications. package fsnotify diff --git a/kqueue.go b/kqueue.go index 86e76a3d..b23d2dd5 100644 --- a/kqueue.go +++ b/kqueue.go @@ -99,7 +99,7 @@ func (w *Watcher) Add(name string) error { return err } -// Remove stops watching the the named file or directory (non-recursively). +// Remove stops watching the named file or directory (non-recursively). func (w *Watcher) Remove(name string) error { name = filepath.Clean(name) w.mu.Lock() diff --git a/plan9.go b/plan9.go new file mode 100644 index 00000000..372f948e --- /dev/null +++ b/plan9.go @@ -0,0 +1,35 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build plan9 + +package fsnotify + +import "syscall" + +// Watcher watches a set of files, delivering events to a channel. +type Watcher struct { + Events chan Event + Errors chan error +} + +// NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. +func NewWatcher() (*Watcher, error) { + return nil, syscall.EPLAN9 +} + +// Close removes all watches and closes the events channel. +func (w *Watcher) Close() error { + return syscall.EPLAN9 +} + +// Add starts watching the named file or directory (non-recursively). +func (w *Watcher) Add(name string) error { + return syscall.EPLAN9 +} + +// Remove stops watching the named file or directory (non-recursively). +func (w *Watcher) Remove(name string) error { + return syscall.EPLAN9 +} diff --git a/windows.go b/windows.go index 09436f31..a6b296df 100644 --- a/windows.go +++ b/windows.go @@ -81,7 +81,7 @@ func (w *Watcher) Add(name string) error { return <-in.reply } -// Remove stops watching the the named file or directory (non-recursively). +// Remove stops watching the named file or directory (non-recursively). func (w *Watcher) Remove(name string) error { in := &input{ op: opRemoveWatch,