Skip to content

Conversation

@technoweenie
Copy link

This updates listRecursive() to check the ignored or hidden status of a file path before calling the filter hooks. This can have massive CPU savings if the watcher ignores a massive sub directory in a recursively-watched directory.

It's also consistent with list():

watcher/watcher.go

Lines 260 to 272 in f5989f8

if ignored || (w.ignoreHidden && isHidden) {
continue
}
for _, f := range w.ffh {
err := f(fInfo, path)
if err == ErrSkip {
continue outer
}
if err != nil {
return nil, err
}
}

xiaoyang-chen pushed a commit to xiaoyang-chen/file-watcher that referenced this pull request Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant