mirror of
https://github.com/ManyakRus/crud_generator.git
synced 2024-12-22 00:36:41 +02:00
21 lines
384 B
Go
21 lines
384 B
Go
//go:build !windows && !plan9 && !js
|
|
// +build !windows,!plan9,!js
|
|
|
|
package copy
|
|
|
|
import (
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func preserveLtimes(src, dest string) error {
|
|
info := new(unix.Stat_t)
|
|
if err := unix.Lstat(src, info); err != nil {
|
|
return err
|
|
}
|
|
|
|
return unix.Lutimes(dest, []unix.Timeval{
|
|
unix.NsecToTimeval(info.Atim.Nano()),
|
|
unix.NsecToTimeval(info.Mtim.Nano()),
|
|
})
|
|
}
|