status-go/vendor/github.com/anacrolix/missinggo/v2/atime_atimespec.go

16 lines
275 B
Go
Raw Normal View History

2022-03-10 09:44:48 +00:00
//go:build darwin || freebsd || netbsd
// +build darwin freebsd netbsd
package missinggo
import (
"os"
"syscall"
"time"
)
func fileInfoAccessTime(fi os.FileInfo) time.Time {
ts := fi.Sys().(*syscall.Stat_t).Atimespec
return time.Unix(int64(ts.Sec), int64(ts.Nsec))
}