2024-08-26 21:03:25 +00:00
|
|
|
package fs
|
2015-02-03 20:18:19 +00:00
|
|
|
|
|
|
|
import (
|
2024-10-04 08:06:18 +00:00
|
|
|
"github.com/restic/restic/internal/restic"
|
2024-10-04 09:06:26 +00:00
|
|
|
"golang.org/x/sys/unix"
|
2015-02-03 20:18:19 +00:00
|
|
|
)
|
|
|
|
|
2024-10-04 08:06:18 +00:00
|
|
|
// utimesNano is like syscall.UtimesNano, except that it does not follow symlinks.
|
|
|
|
func utimesNano(path string, atime, mtime int64, _ restic.NodeType) error {
|
2016-08-30 19:44:10 +00:00
|
|
|
times := []unix.Timespec{
|
2024-10-04 08:06:18 +00:00
|
|
|
unix.NsecToTimespec(atime),
|
|
|
|
unix.NsecToTimespec(mtime),
|
2015-05-16 11:25:10 +00:00
|
|
|
}
|
2024-10-04 08:06:18 +00:00
|
|
|
return unix.UtimesNanoAt(unix.AT_FDCWD, path, times, unix.AT_SYMLINK_NOFOLLOW)
|
2015-05-14 21:06:11 +00:00
|
|
|
}
|