github.com/miqui/docker@v1.9.1/pkg/archive/changes_unix.go (about) 1 // +build !windows 2 3 package archive 4 5 import ( 6 "syscall" 7 8 "github.com/docker/docker/pkg/system" 9 ) 10 11 func statDifferent(oldStat *system.StatT, newStat *system.StatT) bool { 12 // Don't look at size for dirs, its not a good measure of change 13 if oldStat.Mode() != newStat.Mode() || 14 oldStat.UID() != newStat.UID() || 15 oldStat.GID() != newStat.GID() || 16 oldStat.Rdev() != newStat.Rdev() || 17 // Don't look at size for dirs, its not a good measure of change 18 (oldStat.Mode()&syscall.S_IFDIR != syscall.S_IFDIR && 19 (!sameFsTimeSpec(oldStat.Mtim(), newStat.Mtim()) || (oldStat.Size() != newStat.Size()))) { 20 return true 21 } 22 return false 23 } 24 25 func (info *FileInfo) isDir() bool { 26 return info.parent == nil || info.stat.Mode()&syscall.S_IFDIR != 0 27 }