changes_windows.go 957 B

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