summaryrefslogtreecommitdiff
path: root/vendor/github.com/otiai10/copy/stat_times_freebsd.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/otiai10/copy/stat_times_freebsd.go')
-rw-r--r--vendor/github.com/otiai10/copy/stat_times_freebsd.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/github.com/otiai10/copy/stat_times_freebsd.go b/vendor/github.com/otiai10/copy/stat_times_freebsd.go
new file mode 100644
index 0000000..5309334
--- /dev/null
+++ b/vendor/github.com/otiai10/copy/stat_times_freebsd.go
@@ -0,0 +1,20 @@
+//go:build freebsd
+// +build freebsd
+
+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.Atimespec.Sec), int64(stat.Atimespec.Nsec)),
+ Ctime: time.Unix(int64(stat.Ctimespec.Sec), int64(stat.Ctimespec.Nsec)),
+ }
+ return times
+}