blob: fb67df3a06ab9d232738a58450bc9583310fd836 [file] [log] [blame]
// 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)
// For now, pretend files have all bits. This should really be:
// fs.mode = FileMode(fs.sys.Dev & 0777)
// but we don't really set file modes properly and testing for executables
// in $PATH fails without the x bit set.
fs.mode = FileMode(0766)
switch fs.sys.Dev & 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{}
}