2024-10-04 10:06:18 +02:00
|
|
|
//go:build !linux && unix
|
|
|
|
|
|
|
|
|
|
package fs
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"syscall"
|
|
|
|
|
|
2025-09-23 20:01:09 +02:00
|
|
|
"github.com/restic/restic/internal/data"
|
2024-10-04 10:06:18 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// utimesNano is like syscall.UtimesNano, except that it skips symlinks.
|
2025-09-23 20:01:09 +02:00
|
|
|
func utimesNano(path string, atime, mtime int64, typ data.NodeType) error {
|
|
|
|
|
if typ == data.NodeTypeSymlink {
|
2024-10-04 10:06:18 +02:00
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return syscall.UtimesNano(path, []syscall.Timespec{
|
|
|
|
|
syscall.NsecToTimespec(atime),
|
|
|
|
|
syscall.NsecToTimespec(mtime),
|
|
|
|
|
})
|
|
|
|
|
}
|