2022-03-28 20:23:47 +00:00
|
|
|
//go:build windows
|
|
|
|
// +build windows
|
2015-08-17 09:10:12 +00:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2020-08-22 18:39:03 +00:00
|
|
|
"io"
|
2017-01-30 23:14:20 +00:00
|
|
|
"io/ioutil"
|
2015-08-17 09:10:12 +00:00
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
2020-08-22 18:39:03 +00:00
|
|
|
func (e *dirEntry) equals(out io.Writer, other *dirEntry) bool {
|
2015-08-17 09:10:12 +00:00
|
|
|
if e.path != other.path {
|
2020-08-22 18:39:03 +00:00
|
|
|
fmt.Fprintf(out, "%v: path does not match (%v != %v)\n", e.path, e.path, other.path)
|
2015-08-17 09:10:12 +00:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
if e.fi.Mode() != other.fi.Mode() {
|
2020-08-22 18:39:03 +00:00
|
|
|
fmt.Fprintf(out, "%v: mode does not match (%v != %v)\n", e.path, e.fi.Mode(), other.fi.Mode())
|
2015-08-17 09:10:12 +00:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
if !sameModTime(e.fi, other.fi) {
|
2020-08-22 18:39:03 +00:00
|
|
|
fmt.Fprintf(out, "%v: ModTime does not match (%v != %v)\n", e.path, e.fi.ModTime(), other.fi.ModTime())
|
2015-08-17 09:10:12 +00:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
return true
|
|
|
|
}
|
2017-01-30 23:14:20 +00:00
|
|
|
|
|
|
|
func nlink(info os.FileInfo) uint64 {
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
func inode(info os.FileInfo) uint64 {
|
|
|
|
return uint64(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
func createFileSetPerHardlink(dir string) map[uint64][]string {
|
|
|
|
linkTests := make(map[uint64][]string)
|
|
|
|
files, err := ioutil.ReadDir(dir)
|
|
|
|
if err != nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
for i, f := range files {
|
|
|
|
linkTests[uint64(i)] = append(linkTests[uint64(i)], f.Name())
|
|
|
|
}
|
|
|
|
return linkTests
|
|
|
|
}
|