Merge pull request #32 from 0x001D/master

detect file size modification for polling
This commit is contained in:
Nino Khodabandeh 2015-09-30 10:46:22 -07:00
commit 9ca2efc54b
1 changed files with 6 additions and 0 deletions

View File

@ -91,6 +91,12 @@ func (fw *PollingFileWatcher) ChangeEvents(t *tomb.Tomb, origFi os.FileInfo) *Fi
prevSize = fw.Size prevSize = fw.Size
continue continue
} }
// File got bigger?
if prevSize > 0 && prevSize < fw.Size {
changes.NotifyModified()
prevSize = fw.Size
continue
}
prevSize = fw.Size prevSize = fw.Size
// File was appended to (changed)? // File was appended to (changed)?