File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ Events contain the `os.FileInfo` of the file or directory that the event is base
15
15
[ Watcher Command] ( #command )
16
16
17
17
# Update
18
- Event.Path for Rename and Move events is now returned in the format of ` fromPath -> toPath `
18
+ - Added new file filter hooks (Including a built in regexp filtering hook) [ Dec 12, 2018]
19
+ - Event.Path for Rename and Move events is now returned in the format of ` fromPath -> toPath `
19
20
20
21
#### Chmod event is not supported under windows.
21
22
@@ -68,6 +69,11 @@ func main() {
68
69
// Only notify rename and move events.
69
70
w.FilterOps (watcher.Rename , watcher.Move )
70
71
72
+ // Only files that match the regular expression during file listings
73
+ // will be watched.
74
+ r := regexp.MustCompile (" ^abc$" )
75
+ w.AddFilterHook (watcher.RegexFilterHook (r, false ))
76
+
71
77
go func () {
72
78
for {
73
79
select {
You can’t perform that action at this time.
0 commit comments