From 604d99043e3760e98956770a1bf9943b2d45220e Mon Sep 17 00:00:00 2001 From: 0x001D Date: Thu, 12 Jun 2014 00:22:14 +0200 Subject: [PATCH] detect file size modification for polling polling did not work (at least for a win32 environment) --- watch/polling.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/watch/polling.go b/watch/polling.go index b32bf9e..f1b3b55 100644 --- a/watch/polling.go +++ b/watch/polling.go @@ -84,6 +84,12 @@ func (fw *PollingFileWatcher) ChangeEvents(t *tomb.Tomb, origFi os.FileInfo) *Fi prevSize = fw.Size continue } + // File got bigger? + if prevSize > 0 && prevSize < fw.Size { + changes.NotifyModified() + prevSize = fw.Size + continue + } prevSize = fw.Size // File was appended to (changed)?