Skip to content

Watch only directories containing target files#7

Merged
mattn merged 1 commit intomattn:masterfrom
choplin:watch_only_target
Oct 29, 2016
Merged

Watch only directories containing target files#7
mattn merged 1 commit intomattn:masterfrom
choplin:watch_only_target

Conversation

@choplin
Copy link
Copy Markdown
Contributor

@choplin choplin commented Oct 29, 2016

Currently, goemon watches all directories under the current directory.

err = filepath.Walk(root, func(path string, info os.FileInfo, err error) error {

In Mac, fsnotify.Add opens all files under the directory, which is likely to cause "too many open files" error.

This PR checks whether a directory contains a file which matches the pattern specified by the user before adding to fsnotify.

here are my go veresion and go env.

❯ go version
go version go1.7.3 darwin/amd64
❯ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/okuno/.go"
GORACE=""
GOROOT="/usr/local/opt/go/libexec"
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/t9/_rzzzbgs7nb2sclqh1f2flr40000gn/T/go-build061422342=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

@mattn mattn merged commit 068e167 into mattn:master Oct 29, 2016
@mattn
Copy link
Copy Markdown
Owner

mattn commented Oct 29, 2016

Thank you

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.

2 participants