You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
427 B
Go
21 lines
427 B
Go
//go:build windows
|
|
// +build windows
|
|
|
|
package starlog
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
"time"
|
|
)
|
|
|
|
func GetFileCreationTime(fileinfo os.FileInfo) time.Time {
|
|
d := fileinfo.Sys().(*syscall.Win32FileAttributeData)
|
|
return time.Unix(0, d.CreationTime.Nanoseconds())
|
|
}
|
|
|
|
func GetFileAccessTime(fileinfo os.FileInfo) time.Time {
|
|
d := fileinfo.Sys().(*syscall.Win32FileAttributeData)
|
|
return time.Unix(0, d.LastAccessTime.Nanoseconds())
|
|
}
|