github.com/rentongzhang/docker@v1.8.2-rc1/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.Stat_t, newStat *system.Stat_t) 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  }