File: atime_atimespec.go

package info (click to toggle)
golang-github-anacrolix-missinggo 2.1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 836 kB
  • sloc: makefile: 4
file content (14 lines) | stat: -rw-r--r-- 236 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// +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))
}