mirror of
https://github.com/ManyakRus/crud_generator.git
synced 2025-01-04 13:23:00 +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
|
||
|
}
|