mirror of
https://github.com/octoleo/restic.git
synced 2024-12-12 14:17:57 +00:00
22 lines
436 B
Go
22 lines
436 B
Go
|
//go:build !linux && unix
|
||
|
|
||
|
package fs
|
||
|
|
||
|
import (
|
||
|
"syscall"
|
||
|
|
||
|
"github.com/restic/restic/internal/restic"
|
||
|
)
|
||
|
|
||
|
// utimesNano is like syscall.UtimesNano, except that it skips symlinks.
|
||
|
func utimesNano(path string, atime, mtime int64, typ restic.NodeType) error {
|
||
|
if typ == restic.NodeTypeSymlink {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
return syscall.UtimesNano(path, []syscall.Timespec{
|
||
|
syscall.NsecToTimespec(atime),
|
||
|
syscall.NsecToTimespec(mtime),
|
||
|
})
|
||
|
}
|