LEFT | RIGHT |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package os | 5 package os |
6 | 6 |
7 import ( | 7 import ( |
8 "syscall" | 8 "syscall" |
9 "time" | 9 "time" |
10 ) | 10 ) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 52 } |
53 | 53 |
54 func timespecToTime(ts syscall.Timespec) time.Time { | 54 func timespecToTime(ts syscall.Timespec) time.Time { |
55 return time.Unix(int64(ts.Sec), int64(ts.Nsec)) | 55 return time.Unix(int64(ts.Sec), int64(ts.Nsec)) |
56 } | 56 } |
57 | 57 |
58 // For testing. | 58 // For testing. |
59 func atime(fi FileInfo) time.Time { | 59 func atime(fi FileInfo) time.Time { |
60 return timespecToTime(fi.Sys().(*syscall.Stat_t).Atim) | 60 return timespecToTime(fi.Sys().(*syscall.Stat_t).Atim) |
61 } | 61 } |
LEFT | RIGHT |