-
Notifications
You must be signed in to change notification settings - Fork 4
/
fswatch.go
35 lines (30 loc) · 1.06 KB
/
fswatch.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package fswatch
import (
"time"
)
// These values represent the events fswatch knows about. fswatch uses a
// stat(2) call to look up file information; a file will only have a NOPERM
// event if the parent directory has no search permission (i.e. parent
// directory doesn't have executable permissions for the current user).
const (
NONE = iota // No event, initial state.
CREATED // File was created.
DELETED // File was deleted.
MODIFIED // File was modified.
PERM // Changed permissions
NOEXIST // File does not exist.
NOPERM // No permissions for the file (see const block comment).
INVALID // Any type of error not represented above.
)
// NotificationBufLen is the number of notifications that should be buffered
// in the channel.
var NotificationBufLen = 16
// WatchDelay is the duration between path scans. It defaults to 100ms.
var WatchDelay time.Duration
func init() {
del, err := time.ParseDuration("100ms")
if err != nil {
panic("couldn't set up fswatch: " + err.Error())
}
WatchDelay = del
}