Coding Robin

Watchgopher

30 April 2013, posted by Thorsten Ball

A couple of weeks ago I released Watchgopher, a tool that lets you watch directories, listen to file events and react to them.

It’s a simple server written in Go that dispatches file events to pre-configured commands, which can be anything you want them to be: a simple bash script, a small program written in Ruby or a large application written in C. All that’s necessary is for the command to react to two command line arguments which Watchgopher will hand over to them.

Watchgopher Screenshot

The use-cases are numerous and diverse: managing large file collections, backing up files, archiving GIFs, running tests, compiling and building projects and much more.

The goal when building Watchgopher was for it to be as simple and portable as possible and also for me to get to know the Go programming language better. That resulted in a small and easy to comprehend code base, making its source an ideal read if you want to learn Go.

If you’re interested in using Watchgopher and how to use it: I wrote a lengthy blogpost about Watchgopher and how to use it.

Since writing that blog post a couple of features have been added to Watchgopher, including the ability to log the output of the command and to change its working directory, making it even more versatile.

So, have a look at Watchgopher, either for studying the source code and learning about Go’s channels, how to write simple test suites in Go or to find configuration options. Any feedback is welcome!

I love building web applications!

I am a flexible software developer. I work closely with my clients to help them realize their ideas & projects, from beginning to end, using a wide range of technologies.

Robin Mehner

Robin Mehner has over a decade of experience building & shipping software, using Ruby, JavaScript, Node.js, SQL & NoSQL databases, PHP, Go and many more technologies. He also loves to organize community events.

This is what we do for fun!