New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch only directories containing target files #7

Merged
merged 1 commit into from Oct 29, 2016

Conversation

Projects
None yet
2 participants
@choplin
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@mattn

mattn Oct 29, 2016

Owner

Thank you

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