/
system.go
34 lines (31 loc) · 847 Bytes
/
system.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package paths
import (
"io"
"os"
"os/user"
"time"
)
type File interface {
io.ReadCloser
io.WriteSeeker
}
type System interface {
Chmod(name string, mode os.FileMode) error
Chtimes(name string, atime time.Time, mtime time.Time) error
CurrentUser() (*user.User, error)
Getwd() (dir string, err error)
Glob(pattern string) (matches []string, err error)
Join(elem ...string) string
Lstat(name string) (os.FileInfo, error)
MkdirAll(path string, perm os.FileMode) error
OpenFile(name string, flag int, perm os.FileMode) (File, error)
ReadDir(name string) ([]os.DirEntry, error)
ReadFile(name string) ([]byte, error)
Readlink(name string) (string, error)
Remove(name string) error
RemoveAll(path string) error
Rename(oldpath, newpath string) error
Root() string
SupportsSymlinks() bool
Symlink(oldname, newname string) error
}