Modified for systems without inotify (e.g. OS X, *BSD, etc)