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.
27 lines
529 B
Go
27 lines
529 B
Go
// +build windows
|
|
|
|
package staros
|
|
|
|
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())
|
|
}
|
|
|
|
func SetFileTimes(file *os.File,info os.FileInfo) {
|
|
|
|
}
|
|
|
|
func SetFileTimesbyTime(file *os.File) {
|
|
syscall.SetFileTime()
|
|
} |