| 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_plan9.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 = false |
| 20 | ) |
| 21 | |
| 22 | type timespec struct { |
| 23 | atime |
| 24 | mtime |
| 25 | noctime |
| 26 | nobtime |
| 27 | } |
| 28 | |
| 29 | func getTimespec(fi os.FileInfo) (t timespec) { |
| 30 | stat := fi.Sys().(*syscall.Dir) |
| 31 | t.atime.v = time.Unix(int64(stat.Atime), 0) |
| 32 | t.mtime.v = time.Unix(int64(stat.Mtime), 0) |
| 33 | return t |
| 34 | } |