fix a regression with truncation detection

This commit is contained in:
Sridhar Ratnakumar 2013-05-29 15:08:24 -07:00
parent de27e252a7
commit 68dffd22b4
2 changed files with 3 additions and 0 deletions

View File

@ -107,6 +107,7 @@ func (fw *InotifyFileWatcher) ChangeEvents(t tomb.Tomb, fi os.FileInfo) *FileCha
}else{
changes.NotifyModified()
}
prevSize = fw.Size
}
}
}()

View File

@ -80,8 +80,10 @@ func (fw *PollingFileWatcher) ChangeEvents(t tomb.Tomb, origFi os.FileInfo) *Fil
fw.Size = fi.Size()
if prevSize > 0 && prevSize > fw.Size {
changes.NotifyTruncated()
prevSize = fw.Size
continue
}
prevSize = fw.Size
// File was appended to (changed)?
modTime := fi.ModTime()