Initial commit - fsnotify-shim - [fork] go fsnotify shim for 9front
(HTM) git clone git@git.drkhsh.at/fsnotify-shim.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit fe6c22c580db7155b444a7b5306ca1a85343a131
(HTM) Author: Drew DeVault <sir@cmpwn.com>
Date: Sun, 22 Sep 2019 13:55:16 +0000
Initial commit
Diffstat:
A README.md | 8 ++++++++
A fsnotify.go | 52 +++++++++++++++++++++++++++++++
A go.mod | 1 +
3 files changed, 61 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/README.md b/README.md
@@ -0,0 +1,8 @@
+# fsnotify shim
+
+This is a no-op shim for [fsnotify](https://github.com/fsnotify/fsnotify)
+for platforms which don't support it, such as Plan 9.
+
+## TODO
+
+- Use goroutines and polling to emulate fsnotify?
(DIR) diff --git a/fsnotify.go b/fsnotify.go
@@ -0,0 +1,52 @@
+package fsnotify
+
+import (
+ "errors"
+)
+
+var (
+ ErrEventOverflow = errors.New("fsnotify queue overflow")
+)
+
+type Event struct {
+ Name string
+ Op Op
+}
+
+func (e Event) String() string {
+ return ""
+}
+
+type Op uint32
+
+const (
+ Create Op = 1 << iota
+ Write
+ Remove
+ Rename
+ Chmod
+)
+
+type Watcher struct {
+ Events chan Event
+ Errors chan error
+}
+
+func NewWatcher() (*Watcher, error) {
+ return &Watcher{
+ Events: make(chan Event),
+ Errors: make(chan error),
+ }, nil
+}
+
+func (w *Watcher) Add(name string) error {
+ return nil
+}
+
+func (w *Watcher) Close() error {
+ return nil
+}
+
+func (w *Watcher) Remove(name string) error {
+ return nil
+}
(DIR) diff --git a/go.mod b/go.mod
@@ -0,0 +1 @@
+module github.com/fsnotify-shim/fsnotify-shim