mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-14 07:27:07 +08:00
20
vendor/github.com/tonistiigi/fsutil/chtimes_nolinux.go
generated
vendored
Normal file
20
vendor/github.com/tonistiigi/fsutil/chtimes_nolinux.go
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// +build !linux
|
||||
|
||||
package fsutil
|
||||
|
||||
import (
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
func chtimes(path string, un int64) error {
|
||||
mtime := time.Unix(0, un)
|
||||
fi, err := os.Lstat(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if fi.Mode()&os.ModeSymlink != 0 {
|
||||
return nil
|
||||
}
|
||||
return os.Chtimes(path, mtime, mtime)
|
||||
}
|
Reference in New Issue
Block a user