Concurrent file finder in golang.
- Clone the repository.
- Set your
GOPATH
to the repository's root. - Run
make install
in the repository's root. - Run gfind like this:
gfind -start <path-to-starting-directory> -pattern <pattern-to-match-against>
- Special regex characters must be escaped when supplying the
-pattern
option. - By default, much like GNU's
find
,gfind
will output all errors it encounters tostderr
. If you would like to silence said errors, make sure to redirectstderr
to thenull
device, i.e. tack on a2>/dev/null
to the end of the command.
Suppose the absolute path to the current working directory is /Users/batman/awesomeProject
and it has a hierarchy as follows:
.
├── Makefile
├── README.md
├── bin
├── pkg
└── src
└── user
└── gfind
├── find
│ └── versions
│ ├── v1
│ │ └── finder_v1.go
│ └── v2
│ └── finder_v2.go
├── finder.go
├── finder_test.go
├── main.go
├── parse_flags_test.go
├── string_queue.go
└── string_queue_test.go
If we were to run:
gfind -start . -pattern "finder.*\.go" 2>/dev/null
The output would be:
start: /Users/batman/awesomeProject, pattern: finder.*\.go
Using 12 workers !
/Users/batman/awesomeProject/src/user/gfind/finder.go
/Users/batman/awesomeProject/src/user/gfind/finder_test.go
/Users/batman/awesomeProject/src/user/gfind/find/versions/v1/finder_v1.go
/Users/batman/awesomeProject/src/user/gfind/find/versions/v2/finder_v2.go