Skip to content

Commit 59f4c52

Browse files
committed
updated README
1 parent cfaa0d6 commit 59f4c52

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Events contain the `os.FileInfo` of the file or directory that the event is base
1515
[Watcher Command](#command)
1616

1717
# 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`
1920

2021
#### Chmod event is not supported under windows.
2122

@@ -68,6 +69,11 @@ func main() {
6869
// Only notify rename and move events.
6970
w.FilterOps(watcher.Rename, watcher.Move)
7071

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+
7177
go func() {
7278
for {
7379
select {

0 commit comments

Comments
 (0)