| // 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. |
| |
| package os |
| |
| import ( |
| "time" |
| ) |
| |
| func fillFileStatFromSys(fs *fileStat, name string) { |
| fs.name = basename(name) |
| fs.size = int64(fs.sys.Size) |
| // We don't support POSIX mode bits on most Fuchsia filesystems, and testing for executables |
| // in $PATH fails without the x bit set. For now we just set rwxrw-rw- on everything. |
| fs.mode = FileMode(0766) |
| if fs.sys.IsDir { |
| fs.mode = fs.mode | ModeDir |
| } |
| switch fs.sys.Mode & 0xf000 { |
| case 0x4000: |
| fs.mode = fs.mode | ModeDir |
| case 0x2000: |
| fs.mode = fs.mode | ModeCharDevice |
| case 0xa000: |
| fs.mode = fs.mode | ModeSymlink |
| case 0xc000: |
| fs.mode = fs.mode | ModeSocket |
| } |
| fs.modTime = time.Unix(int64(fs.sys.ModifyTime), 0) |
| } |
| |
| func atime(fi FileInfo) time.Time { |
| // TODO: fdio doesn't have atime yet |
| return time.Time{} |
| } |