Source File
fs.go
Belonging Package
io/fs
package fs
import (
)
func ( string) bool {
if !utf8.ValidString() {
return false
}
return true
}
Name() string
IsDir() bool
Type() FileMode
type ReadDirFile interface {
File
var (
ErrInvalid = errInvalid() // "invalid argument"
ErrPermission = errPermission() // "permission denied"
ErrExist = errExist() // "file already exists"
ErrNotExist = errNotExist() // "file does not exist"
ErrClosed = errClosed() // "file already closed"
)
func () error { return oserror.ErrInvalid }
func () error { return oserror.ErrPermission }
func () error { return oserror.ErrExist }
func () error { return oserror.ErrNotExist }
func () error { return oserror.ErrClosed }
type FileInfo interface {
Name() string // base name of the file
Size() int64 // length in bytes for regular files; system-dependent for others
Mode() FileMode // file mode bits
ModTime() time.Time // modification time
IsDir() bool // abbreviation for Mode().IsDir()
Sys() interface{} // underlying data source (can return nil)
}
ModeDir FileMode = 1 << (32 - 1 - iota) // d: is a directory
ModeAppend // a: append-only
ModeExclusive // l: exclusive use
ModeTemporary // T: temporary file; Plan 9 only
ModeSymlink // L: symbolic link
ModeDevice // D: device file
ModeNamedPipe // p: named pipe (FIFO)
ModeSocket // S: Unix domain socket
ModeSetuid // u: setuid
ModeSetgid // g: setgid
ModeCharDevice // c: Unix character device, when ModeDevice is set
ModeSticky // t: sticky
ModeIrregular // ?: non-regular file; nothing else is known about this file
ModeType = ModeDir | ModeSymlink | ModeNamedPipe | ModeSocket | ModeDevice | ModeCharDevice | ModeIrregular
ModePerm FileMode = 0777 // Unix permission bits
)
func ( FileMode) () string {
const = "dalTLDpSugct?"
var [32]byte // Mode is uint32.
:= 0
for , := range {
if &(1<<uint(32-1-)) != 0 {
[] = byte()
++
}
}
if == 0 {
[] = '-'
++
}
const = "rwxrwxrwx"
for , := range {
if &(1<<uint(9-1-)) != 0 {
[] = byte()
} else {
[] = '-'
}
++
}
return string([:])
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin 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 @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |