From 760f3e6edcb693e49ce66eba2c0229b05acc73de Mon Sep 17 00:00:00 2001 From: David Sansome Date: Tue, 29 Sep 2015 18:02:16 +1000 Subject: [PATCH] Fix BlockUntilExists for relative paths. filepath.Dir("foo") returns ".", so the inotify events are of the form "./foo", which is not equal to the filename being watched ("foo") --- watch/inotify.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/watch/inotify.go b/watch/inotify.go index f263b56..55c8fab 100644 --- a/watch/inotify.go +++ b/watch/inotify.go @@ -46,7 +46,7 @@ func (fw *InotifyFileWatcher) BlockUntilExists(t *tomb.Tomb) error { case evt, ok := <-fw.w.Event: if !ok { return fmt.Errorf("inotify watcher has been closed") - } else if evt.Name == fw.Filename { + } else if filepath.Base(evt.Name) == filepath.Base(fw.Filename) { return nil } case <-t.Dying():