mirror of
https://github.com/ManyakRus/crud_generator.git
synced 2024-12-22 00:36:41 +02:00
23 lines
484 B
Go
23 lines
484 B
Go
//go:build !windows && !darwin && !freebsd && !plan9 && !netbsd && !js
|
|
// +build !windows,!darwin,!freebsd,!plan9,!netbsd,!js
|
|
|
|
// TODO: add more runtimes
|
|
|
|
package copy
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
"time"
|
|
)
|
|
|
|
func getTimeSpec(info os.FileInfo) timespec {
|
|
stat := info.Sys().(*syscall.Stat_t)
|
|
times := timespec{
|
|
Mtime: info.ModTime(),
|
|
Atime: time.Unix(int64(stat.Atim.Sec), int64(stat.Atim.Nsec)),
|
|
Ctime: time.Unix(int64(stat.Ctim.Sec), int64(stat.Ctim.Nsec)),
|
|
}
|
|
return times
|
|
}
|