equal
deleted
inserted
replaced
1 // Copyright 2010 The Go Authors. All rights reserved. |
1 // Copyright 2010 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style |
2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. |
3 // license that can be found in the LICENSE file. |
4 |
4 |
|
5 //go:build freebsd || openbsd || netbsd || dragonfly || darwin |
5 // +build freebsd openbsd netbsd dragonfly darwin |
6 // +build freebsd openbsd netbsd dragonfly darwin |
6 |
7 |
7 package fsnotify |
8 package fsnotify |
8 |
9 |
9 import ( |
10 import ( |
143 w.Remove(name) |
144 w.Remove(name) |
144 } |
145 } |
145 } |
146 } |
146 |
147 |
147 return nil |
148 return nil |
|
149 } |
|
150 |
|
151 // WatchList returns the directories and files that are being monitered. |
|
152 func (w *Watcher) WatchList() []string { |
|
153 w.mu.Lock() |
|
154 defer w.mu.Unlock() |
|
155 |
|
156 entries := make([]string, 0, len(w.watches)) |
|
157 for pathname := range w.watches { |
|
158 entries = append(entries, pathname) |
|
159 } |
|
160 |
|
161 return entries |
148 } |
162 } |
149 |
163 |
150 // Watch all events (except NOTE_EXTEND, NOTE_LINK, NOTE_REVOKE) |
164 // Watch all events (except NOTE_EXTEND, NOTE_LINK, NOTE_REVOKE) |
151 const noteAllEvents = unix.NOTE_DELETE | unix.NOTE_WRITE | unix.NOTE_ATTRIB | unix.NOTE_RENAME |
165 const noteAllEvents = unix.NOTE_DELETE | unix.NOTE_WRITE | unix.NOTE_ATTRIB | unix.NOTE_RENAME |
152 |
166 |