Documentation
¶
Overview ¶
Package inotify provides a platform-independent interface for file system notifications.
Copyright © 2020 GUILLAUME FOURNIER ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package recursive_inotify implements recursive folder monitoring by wrapping the excellent inotify library
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrEventOverflow = errors.New("inotify queue overflow")
Common errors that can be reported by a watcher
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Name string // Relative path to the file or directory. Op Op // File operation that triggered the event. }
Event represents a single file system notification.
type Op ¶
type Op uint32
Op describes a set of file operations.
These are the generalized file operations that can trigger a notification.
type RWatcher ¶
type RWatcher struct { Events chan Event Errors chan error // contains filtered or unexported fields }
RWatcher wraps inotify.Watcher. When inotify adds recursive watches, you should be able to switch your code to use inotify.Watcher
func NewRWatcher ¶
NewRWatcher establishes a new watcher with the underlying OS and begins waiting for events.
func (*RWatcher) AddRecursive ¶
AddRecursive starts watching the named directory and all sub-directories.
func (*RWatcher) RemoveRecursive ¶
RemoveRecursive stops watching the named directory and all sub-directories.
type Watcher ¶
type Watcher struct { Events chan Event Errors chan error // contains filtered or unexported fields }
Watcher watches a set of files, delivering events to a channel.
func NewWatcher ¶
NewWatcher establishes a new watcher with the underlying OS and begins waiting for events.