github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/pkg/archive/changes_windows.go (about)

     1  package archive // import "github.com/demonoid81/moby/pkg/archive"
     2  
     3  import (
     4  	"os"
     5  
     6  	"github.com/demonoid81/moby/pkg/system"
     7  )
     8  
     9  func statDifferent(oldStat *system.StatT, newStat *system.StatT) bool {
    10  	// Note there is slight difference between the Linux and Windows
    11  	// implementations here. Due to https://github.com/moby/moby/issues/9874,
    12  	// and the fix at https://github.com/moby/moby/pull/11422, Linux does not
    13  	// consider a change to the directory time as a change. Windows on NTFS
    14  	// does. See https://github.com/moby/moby/pull/37982 for more information.
    15  
    16  	if !sameFsTime(oldStat.Mtim(), newStat.Mtim()) ||
    17  		oldStat.Mode() != newStat.Mode() ||
    18  		oldStat.Size() != newStat.Size() && !oldStat.Mode().IsDir() {
    19  		return true
    20  	}
    21  	return false
    22  }
    23  
    24  func (info *FileInfo) isDir() bool {
    25  	return info.parent == nil || info.stat.Mode().IsDir()
    26  }
    27  
    28  func getIno(fi os.FileInfo) (inode uint64) {
    29  	return
    30  }
    31  
    32  func hasHardlinks(fi os.FileInfo) bool {
    33  	return false
    34  }