Debian Codegraph @

times_windows.go

raw symbols SCIP
1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // http://golang.org/src/os/stat_windows.go
6
7 package times
8
9 import (
10 "os"
11 "syscall"
12 "time"
13 )
14
15 // HasChangeTime and HasBirthTime are true if and only if
16 // the target OS supports them.
17 const (
18 HasChangeTime = false
19 HasBirthTime = true
20 )
21
22 type timespec struct {
23 atime
24 mtime
25 noctime
26 btime
27 }
28
29 func getTimespec(fi os.FileInfo) Timespec {
30 var t timespec
31 stat := fi.Sys().(*syscall.Win32FileAttributeData)
32 t.atime.v = time.Unix(0, stat.LastAccessTime.Nanoseconds())
33 t.mtime.v = time.Unix(0, stat.LastWriteTime.Nanoseconds())
34 t.btime.v = time.Unix(0, stat.CreationTime.Nanoseconds())
35 return t
36 }