From 3c39c22b2c7b0516d5f2553f1608e5d13cb19053 Mon Sep 17 00:00:00 2001 From: Amit Krishnan Date: Wed, 9 Mar 2016 17:19:56 -0800 Subject: [PATCH] Get fsnotify to build clean on Solaris Signed-off-by: Amit Krishnan closes #128 --- AUTHORS | 1 + README.md | 2 +- example_test.go | 2 +- fen.go | 37 +++++++++++++++++++++++++++++++++++++ fsnotify.go | 2 +- 5 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 fen.go diff --git a/AUTHORS b/AUTHORS index 6b0b687..6438bb3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,6 +9,7 @@ # Please keep the list sorted. Adrien Bustany +Amit Krishnan Bjørn Erik Pedersen Caleb Spare Case Nelson diff --git a/README.md b/README.md index ba184c0..fee2a36 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Cross platform: Windows, Linux, BSD and OS X. |kqueue |BSD, OS X, iOS\*|Supported [![Build Status](https://travis-ci.org/fsnotify/fsnotify.svg?branch=master)](https://travis-ci.org/fsnotify/fsnotify)| |ReadDirectoryChangesW|Windows|Supported [![Build status](https://ci.appveyor.com/api/projects/status/ivwjubaih4r0udeh/branch/master?svg=true)](https://ci.appveyor.com/project/NathanYoungman/fsnotify/branch/master)| |FSEvents |OS X |[Planned](https://github.com/fsnotify/fsnotify/issues/11)| -|FEN |Solaris 11 |[Planned](https://github.com/fsnotify/fsnotify/issues/12)| +|FEN |Solaris 11 |[In Progress](https://github.com/fsnotify/fsnotify/issues/12)| |fanotify |Linux 2.6.37+ | | |USN Journals |Windows |[Maybe](https://github.com/fsnotify/fsnotify/issues/53)| |Polling |*All* |[Maybe](https://github.com/fsnotify/fsnotify/issues/9)| diff --git a/example_test.go b/example_test.go index d65cdf3..700502c 100644 --- a/example_test.go +++ b/example_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !plan9,!solaris +// +build !plan9 package fsnotify_test diff --git a/fen.go b/fen.go new file mode 100644 index 0000000..ced39cb --- /dev/null +++ b/fen.go @@ -0,0 +1,37 @@ +// Copyright 2010 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 solaris + +package fsnotify + +import ( + "errors" +) + +// 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, errors.New("FEN based watcher not yet supported for fsnotify\n") +} + +// Close removes all watches and closes the events channel. +func (w *Watcher) Close() error { + return nil +} + +// Add starts watching the named file or directory (non-recursively). +func (w *Watcher) Add(name string) error { + return nil +} + +// Remove stops watching the 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 c899ee0..d1d39a0 100644 --- a/fsnotify.go +++ b/fsnotify.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !plan9,!solaris +// +build !plan9 // Package fsnotify provides a platform-independent interface for file system notifications. package fsnotify -- 2.50.1