mirror of https://gitee.com/godoos/godoos.git
You can not 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
594 B
27 lines
594 B
//go:build windows
|
|
// +build windows
|
|
|
|
package office
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
"time"
|
|
)
|
|
|
|
func getFileInfoData(data *Document) (bool, error) {
|
|
fileinfo, err := os.Stat(data.path)
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
data.Filename = fileinfo.Name()
|
|
data.Title = data.Filename
|
|
data.Size = int(fileinfo.Size())
|
|
|
|
stat := fileinfo.Sys().(*syscall.Win32FileAttributeData)
|
|
data.Createtime = time.Unix(0, stat.CreationTime.Nanoseconds())
|
|
data.Modifytime = time.Unix(0, stat.LastWriteTime.Nanoseconds())
|
|
data.Accesstime = time.Unix(0, stat.LastAccessTime.Nanoseconds())
|
|
|
|
return true, nil
|
|
}
|
|
|