-
Notifications
You must be signed in to change notification settings - Fork 2
/
fs_unix.go
85 lines (64 loc) · 1.55 KB
/
fs_unix.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//go:build !windows
// +build !windows
package fs
import (
"os"
"time"
)
func chdir(dir string) error {
return os.Chdir(dir)
}
func chmod(name string, mode os.FileMode) error {
return os.Chmod(name, mode)
}
func chown(name string, uid, gid int) error {
return os.Chown(name, uid, gid)
}
func chtimes(name string, atime time.Time, mtime time.Time) error {
return os.Chtimes(name, atime, mtime)
}
func lchown(name string, uid, gid int) error {
return os.Lchown(name, uid, gid)
}
func link(oldname, newname string) error {
return os.Link(oldname, newname)
}
func mkdir(name string, perm os.FileMode) error {
return os.Mkdir(name, perm)
}
func mkdirall(path string, perm os.FileMode) error {
return os.MkdirAll(path, perm)
}
func readlink(name string) (string, error) {
return os.Readlink(name)
}
func remove(name string) error {
return os.Remove(name)
}
func removeall(path string) error {
return os.RemoveAll(path)
}
func rename(oldpath, newpath string) error {
return os.Rename(oldpath, newpath)
}
func symlink(oldname, newname string) error {
return os.Symlink(oldname, newname)
}
func create(name string) (*os.File, error) {
return os.Create(name)
}
func newfile(fd uintptr, name string) *os.File {
return os.NewFile(fd, name)
}
func open(name string) (*os.File, error) {
return os.Open(name)
}
func openfile(name string, flag int, perm os.FileMode) (*os.File, error) {
return os.OpenFile(name, flag, perm)
}
func lstat(name string) (os.FileInfo, error) {
return os.Lstat(name)
}
func stat(name string) (os.FileInfo, error) {
return os.Stat(name)
}