Source File
stat_linux.go
Belonging Package
os
// 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 osimport ()func fillFileStatFromSys( *fileStat, string) {.name = filepathlite.Base().size = .sys.Size.modTime = time.Unix(.sys.Mtim.Unix()).mode = FileMode(.sys.Mode & 0777)switch .sys.Mode & syscall.S_IFMT {case syscall.S_IFBLK:.mode |= ModeDevicecase syscall.S_IFCHR:.mode |= ModeDevice | ModeCharDevicecase syscall.S_IFDIR:.mode |= ModeDircase syscall.S_IFIFO:.mode |= ModeNamedPipecase syscall.S_IFLNK:.mode |= ModeSymlinkcase syscall.S_IFREG:// nothing to docase syscall.S_IFSOCK:.mode |= ModeSocket}if .sys.Mode&syscall.S_ISGID != 0 {.mode |= ModeSetgid}if .sys.Mode&syscall.S_ISUID != 0 {.mode |= ModeSetuid}if .sys.Mode&syscall.S_ISVTX != 0 {.mode |= ModeSticky}}// For testing.func atime( FileInfo) time.Time {return time.Unix(.Sys().(*syscall.Stat_t).Atim.Unix())}
![]() |
The pages are generated with Golds v0.7.9-preview. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |