/
os.go
62 lines (60 loc) · 1.97 KB
/
os.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// This file was generated by counterfeiter
// with command: counterfeiter -p -o /Users/pivotal/workspace/local-volume-release/src/code.cloudfoundry.org/goshims/osshim os
// BUT THEN WE MODIFIED IT SO MAKE SURE TO COPY THOSE MODIFICATIONS FORWARDS
package osshim
import (
"os"
"time"
)
//go:generate counterfeiter -o os_fake/fake_os.go . Os
type Os interface {
FindProcess(pid int) (*os.Process, error)
StartProcess(name string, argv []string, attr *os.ProcAttr) (*os.Process, error)
Hostname() (name string, err error)
Expand(s string, mapping func(string) string) string
ExpandEnv(s string) string
Getenv(key string) string
LookupEnv(key string) (string, bool)
Setenv(key, value string) error
Unsetenv(key string) error
Clearenv()
Environ() []string
NewSyscallError(syscall string, err error) error
IsExist(err error) bool
IsNotExist(err error) bool
IsPermission(err error) bool
Getpid() int
Getppid() int
Mkdir(name string, perm os.FileMode) error
Chdir(dir string) error
Open(name string) (File, error)
Create(name string) (File, error)
Rename(oldpath, newpath string) error
NewFile(fd uintptr, name string) File
OpenFile(name string, flag int, perm os.FileMode) (File, error)
Truncate(name string, size int64) error
Remove(name string) error
Chmod(name string, mode os.FileMode) error
Chtimes(name string, atime time.Time, mtime time.Time) error
Pipe() (r File, w File, err error)
Link(oldname, newname string) error
Symlink(oldname, newname string) error
Readlink(name string) (string, error)
Chown(name string, uid, gid int) error
Lchown(name string, uid, gid int) error
TempDir() string
Stat(name string) (os.FileInfo, error)
Lstat(name string) (os.FileInfo, error)
Getwd() (dir string, err error)
MkdirAll(path string, perm os.FileMode) error
RemoveAll(path string) error
IsPathSeparator(c uint8) bool
Getuid() int
Geteuid() int
Getgid() int
Getegid() int
Getgroups() ([]int, error)
Exit(code int)
Getpagesize() int
SameFile(fi1, fi2 os.FileInfo) bool
}