| // Copyright 2009 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| func fillFileStatFromSys(fs *fileStat, name string) { |
| fs.modTime = time.Unix(fs.sys.Mtimespec.Unix()) |
| fs.mode = FileMode(fs.sys.Mode & 0777) |
| switch fs.sys.Mode & syscall.S_IFMT { |
| fs.mode |= ModeDevice | ModeCharDevice |
| if fs.sys.Mode&syscall.S_ISGID != 0 { |
| if fs.sys.Mode&syscall.S_ISUID != 0 { |
| if fs.sys.Mode&syscall.S_ISVTX != 0 { |
| func atime(fi FileInfo) time.Time { |
| return time.Unix(fi.Sys().(*syscall.Stat_t).Atimespec.Unix()) |