2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-04 10:58:26 +00:00
restic/internal/fs/node_linux.go

16 lines
424 B
Go
Raw Normal View History

package fs
import (
"github.com/restic/restic/internal/restic"
"golang.org/x/sys/unix"
)
// utimesNano is like syscall.UtimesNano, except that it does not follow symlinks.
func utimesNano(path string, atime, mtime int64, _ restic.NodeType) error {
times := []unix.Timespec{
unix.NsecToTimespec(atime),
unix.NsecToTimespec(mtime),
}
return unix.UtimesNanoAt(unix.AT_FDCWD, path, times, unix.AT_SYMLINK_NOFOLLOW)
}