fi.Size = int64(sizehi)<<32 + int64(sizelo)
fi.Name = name
fi.FollowedSymlink = false
- // TODO(brainman): use ctime atime wtime to prime following FileInfo fields
- fi.Atime_ns = 0
- fi.Mtime_ns = 0
- fi.Ctime_ns = 0
+ fi.Atime_ns = atime.Microseconds() * 1000
+ fi.Mtime_ns = wtime.Microseconds() * 1000
+ fi.Ctime_ns = ctime.Microseconds() * 1000
return fi
}
func Gettimeofday(tv *Timeval) (errno int) {
var ft Filetime
- // 100-nanosecond intervals since January 1, 1601
GetSystemTimeAsFileTime(&ft)
- t := uint64(ft.HighDateTime)<<32 + uint64(ft.LowDateTime)
- // convert into microseconds
- t /= 10
- // change starting time to the Epoch (00:00:00 UTC, January 1, 1970)
- t -= 11644473600000000
+ ms := ft.Microseconds()
// split into sec / usec
- tv.Sec = int32(t / 1e6)
- tv.Usec = int32(t) - tv.Sec
+ tv.Sec = int32(ms / 1e6)
+ tv.Usec = int32(ms) - tv.Sec
return 0
}
-// mksyscall_mingw.sh -l32 syscall_mingw.go zsyscall_mingw_386.go
+// mksyscall_windows.sh -l32 syscall_windows.go syscall_windows_386.go
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
package syscall
HighDateTime uint32
}
+func (ft *Filetime) Microseconds() int64 {
+ // 100-nanosecond intervals since January 1, 1601
+ ms := int64(ft.HighDateTime)<<32 + int64(ft.LowDateTime)
+ // convert into microseconds
+ ms /= 10
+ // change starting time to the Epoch (00:00:00 UTC, January 1, 1970)
+ ms -= 11644473600000000
+ return ms
+}
+
type Win32finddata struct {
FileAttributes uint32
CreationTime Filetime