- add RawOp field
- support CLOSE events on inotify systems
validations: {"required": true}
attributes:
label: 'Did you try the latest main branch?'
validations: {"required": true}
attributes:
label: 'Did you try the latest main branch?'
- description: 'Please try the latest main branch as well, with e.g.:<br>`go get github.com/fsnotify/fsnotify@main`'
+ description: 'Please try the latest main branch as well, with e.g.:<br>`go get gitlab.ha.xx0r.info/dan/fsnotify@main`'
var flags uint32 = unix.IN_MOVED_TO | unix.IN_MOVED_FROM |
unix.IN_CREATE | unix.IN_ATTRIB | unix.IN_MODIFY |
var flags uint32 = unix.IN_MOVED_TO | unix.IN_MOVED_FROM |
unix.IN_CREATE | unix.IN_ATTRIB | unix.IN_MODIFY |
- unix.IN_MOVE_SELF | unix.IN_DELETE | unix.IN_DELETE_SELF
+ unix.IN_MOVE_SELF | unix.IN_DELETE | unix.IN_DELETE_SELF |
+ unix.IN_CLOSE_WRITE | unix.IN_CLOSE_NOWRITE
return w.watches.updatePath(name, func(existing *watch) (*watch, error) {
if existing != nil {
return w.watches.updatePath(name, func(existing *watch) (*watch, error) {
if existing != nil {
if mask&unix.IN_ATTRIB == unix.IN_ATTRIB {
e.Op |= Chmod
}
if mask&unix.IN_ATTRIB == unix.IN_ATTRIB {
e.Op |= Chmod
}
+ if mask&unix.IN_CLOSE_WRITE == unix.IN_CLOSE_WRITE || mask&unix.IN_CLOSE_NOWRITE == unix.IN_CLOSE_NOWRITE {
+ e.Op |= Close
+ }
+ e.RawOp = mask
- "github.com/fsnotify/fsnotify"
+ "go.fuhry.dev/fsnotify"
)
// Depending on the system, a single "write" can generate many Write events; for
)
// Depending on the system, a single "write" can generate many Write events; for
- "github.com/fsnotify/fsnotify"
+ "go.fuhry.dev/fsnotify"
)
// Watch one or more files, but instead of watching the file directly it watches
)
// Watch one or more files, but instead of watching the file directly it watches
fsnotify is a Go library to provide cross-platform file system notifications.
This command serves as an example and debugging tool.
fsnotify is a Go library to provide cross-platform file system notifications.
This command serves as an example and debugging tool.
-https://github.com/fsnotify/fsnotify
+https://go.fuhry.dev/fsnotify
-import "github.com/fsnotify/fsnotify"
+import "go.fuhry.dev/fsnotify"
// This is the most basic example: it prints events to the terminal as we
// receive them.
// This is the most basic example: it prints events to the terminal as we
// receive them.
// This is a bitmask and some systems may send multiple operations at once.
// Use the Event.Has() method instead of comparing with ==.
Op Op
// This is a bitmask and some systems may send multiple operations at once.
// Use the Event.Has() method instead of comparing with ==.
Op Op
}
// Op describes a set of file operations.
}
// Op describes a set of file operations.
// get triggered very frequently by some software. For example, Spotlight
// indexing on macOS, anti-virus software, backup software, etc.
Chmod
// get triggered very frequently by some software. For example, Spotlight
// indexing on macOS, anti-virus software, backup software, etc.
Chmod
+
+ // File was closed.
+ Close
)
// Common errors that can be reported.
)
// Common errors that can be reported.
if o.Has(Chmod) {
b.WriteString("|CHMOD")
}
if o.Has(Chmod) {
b.WriteString("|CHMOD")
}
+ if o.Has(Close) {
+ b.WriteString("|CLOSE")
+ }
if b.Len() == 0 {
return "[no events]"
}
if b.Len() == 0 {
return "[no events]"
}
- "github.com/fsnotify/fsnotify/internal"
+ "go.fuhry.dev/fsnotify/internal"
)
// Set soft open file limit to the maximum; on e.g. OpenBSD it's 512/1024.
)
// Set soft open file limit to the maximum; on e.g. OpenBSD it's 512/1024.
want string
}{
{Event{}, `[no events] ""`},
want string
}{
{Event{}, `[no events] ""`},
- {Event{"/file", 0}, `[no events] "/file"`},
+ {Event{"/file", 0, 0}, `[no events] "/file"`},
- {Event{"/file", Chmod | Create},
+ {Event{"/file", Chmod | Create, 0},
- {Event{"/file", Rename},
+ {Event{"/file", Rename, 0},
- {Event{"/file", Remove},
+ {Event{"/file", Remove, 0},
- {Event{"/file", Write | Chmod},
+ {Event{"/file", Write | Chmod, 0},
+ {Event{"/file", Write | Close, 0},
+ `WRITE|CLOSE "/file"`},
}
for _, tt := range tests {
}
for _, tt := range tests {
-module github.com/fsnotify/fsnotify
+module go.fuhry.dev/fsnotify
- "github.com/fsnotify/fsnotify/internal"
+ "go.fuhry.dev/fsnotify/internal"