detect file size modification for polling

polling did not work (at least for a win32 environment)
This commit is contained in:
0x001D 2014-06-12 00:22:14 +02:00
parent 8dcd1ad3e5
commit 604d99043e
1 changed files with 6 additions and 0 deletions

View File

@ -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)?