|
@ -12,7 +12,7 @@ import ( |
|
|
func fillFileStatFromSys(fs *fileStat, name string) { |
|
|
func fillFileStatFromSys(fs *fileStat, name string) { |
|
|
fs.name = basename(name) |
|
|
fs.name = basename(name) |
|
|
fs.size = fs.sys.Size |
|
|
fs.size = fs.sys.Size |
|
|
fs.modTime = timespecToTime(fs.sys.Mtim) |
|
|
fs.modTime = timespecToTime(fs.sys.Mtimespec) |
|
|
fs.mode = FileMode(fs.sys.Mode & 0777) |
|
|
fs.mode = FileMode(fs.sys.Mode & 0777) |
|
|
switch fs.sys.Mode & syscall.S_IFMT { |
|
|
switch fs.sys.Mode & syscall.S_IFMT { |
|
|
case syscall.S_IFBLK, syscall.S_IFWHT: |
|
|
case syscall.S_IFBLK, syscall.S_IFWHT: |
|
@ -47,5 +47,5 @@ func timespecToTime(ts syscall.Timespec) time.Time { |
|
|
|
|
|
|
|
|
// For testing.
|
|
|
// For testing.
|
|
|
func atime(fi FileInfo) time.Time { |
|
|
func atime(fi FileInfo) time.Time { |
|
|
return timespecToTime(fi.Sys().(*syscall.Stat_t).Atim) |
|
|
return timespecToTime(fi.Sys().(*syscall.Stat_t).Atimespec) |
|
|
} |
|
|
} |
|
|