File: go1_21_os.go

package info (click to toggle)
golang-github-traefik-yaegi 0.16.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 24,608 kB
  • sloc: sh: 457; makefile: 39
file content (211 lines) | stat: -rw-r--r-- 8,438 bytes parent folder | download
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
// Code generated by 'yaegi extract os'. DO NOT EDIT.

//go:build go1.21 && !go1.22
// +build go1.21,!go1.22

package stdlib

import (
	"go/constant"
	"go/token"
	"io/fs"
	"os"
	"reflect"
	"time"
)

func init() {
	Symbols["os/os"] = map[string]reflect.Value{
		// function, constant and variable definitions
		"Args":                reflect.ValueOf(&os.Args).Elem(),
		"Chdir":               reflect.ValueOf(os.Chdir),
		"Chmod":               reflect.ValueOf(os.Chmod),
		"Chown":               reflect.ValueOf(os.Chown),
		"Chtimes":             reflect.ValueOf(os.Chtimes),
		"Clearenv":            reflect.ValueOf(os.Clearenv),
		"Create":              reflect.ValueOf(os.Create),
		"CreateTemp":          reflect.ValueOf(os.CreateTemp),
		"DevNull":             reflect.ValueOf(constant.MakeFromLiteral("\"/dev/null\"", token.STRING, 0)),
		"DirFS":               reflect.ValueOf(os.DirFS),
		"Environ":             reflect.ValueOf(os.Environ),
		"ErrClosed":           reflect.ValueOf(&os.ErrClosed).Elem(),
		"ErrDeadlineExceeded": reflect.ValueOf(&os.ErrDeadlineExceeded).Elem(),
		"ErrExist":            reflect.ValueOf(&os.ErrExist).Elem(),
		"ErrInvalid":          reflect.ValueOf(&os.ErrInvalid).Elem(),
		"ErrNoDeadline":       reflect.ValueOf(&os.ErrNoDeadline).Elem(),
		"ErrNotExist":         reflect.ValueOf(&os.ErrNotExist).Elem(),
		"ErrPermission":       reflect.ValueOf(&os.ErrPermission).Elem(),
		"ErrProcessDone":      reflect.ValueOf(&os.ErrProcessDone).Elem(),
		"Executable":          reflect.ValueOf(os.Executable),
		"Exit":                reflect.ValueOf(osExit),
		"Expand":              reflect.ValueOf(os.Expand),
		"ExpandEnv":           reflect.ValueOf(os.ExpandEnv),
		"FindProcess":         reflect.ValueOf(osFindProcess),
		"Getegid":             reflect.ValueOf(os.Getegid),
		"Getenv":              reflect.ValueOf(os.Getenv),
		"Geteuid":             reflect.ValueOf(os.Geteuid),
		"Getgid":              reflect.ValueOf(os.Getgid),
		"Getgroups":           reflect.ValueOf(os.Getgroups),
		"Getpagesize":         reflect.ValueOf(os.Getpagesize),
		"Getpid":              reflect.ValueOf(os.Getpid),
		"Getppid":             reflect.ValueOf(os.Getppid),
		"Getuid":              reflect.ValueOf(os.Getuid),
		"Getwd":               reflect.ValueOf(os.Getwd),
		"Hostname":            reflect.ValueOf(os.Hostname),
		"Interrupt":           reflect.ValueOf(&os.Interrupt).Elem(),
		"IsExist":             reflect.ValueOf(os.IsExist),
		"IsNotExist":          reflect.ValueOf(os.IsNotExist),
		"IsPathSeparator":     reflect.ValueOf(os.IsPathSeparator),
		"IsPermission":        reflect.ValueOf(os.IsPermission),
		"IsTimeout":           reflect.ValueOf(os.IsTimeout),
		"Kill":                reflect.ValueOf(&os.Kill).Elem(),
		"Lchown":              reflect.ValueOf(os.Lchown),
		"Link":                reflect.ValueOf(os.Link),
		"LookupEnv":           reflect.ValueOf(os.LookupEnv),
		"Lstat":               reflect.ValueOf(os.Lstat),
		"Mkdir":               reflect.ValueOf(os.Mkdir),
		"MkdirAll":            reflect.ValueOf(os.MkdirAll),
		"MkdirTemp":           reflect.ValueOf(os.MkdirTemp),
		"ModeAppend":          reflect.ValueOf(os.ModeAppend),
		"ModeCharDevice":      reflect.ValueOf(os.ModeCharDevice),
		"ModeDevice":          reflect.ValueOf(os.ModeDevice),
		"ModeDir":             reflect.ValueOf(os.ModeDir),
		"ModeExclusive":       reflect.ValueOf(os.ModeExclusive),
		"ModeIrregular":       reflect.ValueOf(os.ModeIrregular),
		"ModeNamedPipe":       reflect.ValueOf(os.ModeNamedPipe),
		"ModePerm":            reflect.ValueOf(os.ModePerm),
		"ModeSetgid":          reflect.ValueOf(os.ModeSetgid),
		"ModeSetuid":          reflect.ValueOf(os.ModeSetuid),
		"ModeSocket":          reflect.ValueOf(os.ModeSocket),
		"ModeSticky":          reflect.ValueOf(os.ModeSticky),
		"ModeSymlink":         reflect.ValueOf(os.ModeSymlink),
		"ModeTemporary":       reflect.ValueOf(os.ModeTemporary),
		"ModeType":            reflect.ValueOf(os.ModeType),
		"NewFile":             reflect.ValueOf(os.NewFile),
		"NewSyscallError":     reflect.ValueOf(os.NewSyscallError),
		"O_APPEND":            reflect.ValueOf(os.O_APPEND),
		"O_CREATE":            reflect.ValueOf(os.O_CREATE),
		"O_EXCL":              reflect.ValueOf(os.O_EXCL),
		"O_RDONLY":            reflect.ValueOf(os.O_RDONLY),
		"O_RDWR":              reflect.ValueOf(os.O_RDWR),
		"O_SYNC":              reflect.ValueOf(os.O_SYNC),
		"O_TRUNC":             reflect.ValueOf(os.O_TRUNC),
		"O_WRONLY":            reflect.ValueOf(os.O_WRONLY),
		"Open":                reflect.ValueOf(os.Open),
		"OpenFile":            reflect.ValueOf(os.OpenFile),
		"PathListSeparator":   reflect.ValueOf(constant.MakeFromLiteral("58", token.INT, 0)),
		"PathSeparator":       reflect.ValueOf(constant.MakeFromLiteral("47", token.INT, 0)),
		"Pipe":                reflect.ValueOf(os.Pipe),
		"ReadDir":             reflect.ValueOf(os.ReadDir),
		"ReadFile":            reflect.ValueOf(os.ReadFile),
		"Readlink":            reflect.ValueOf(os.Readlink),
		"Remove":              reflect.ValueOf(os.Remove),
		"RemoveAll":           reflect.ValueOf(os.RemoveAll),
		"Rename":              reflect.ValueOf(os.Rename),
		"SEEK_CUR":            reflect.ValueOf(os.SEEK_CUR),
		"SEEK_END":            reflect.ValueOf(os.SEEK_END),
		"SEEK_SET":            reflect.ValueOf(os.SEEK_SET),
		"SameFile":            reflect.ValueOf(os.SameFile),
		"Setenv":              reflect.ValueOf(os.Setenv),
		"StartProcess":        reflect.ValueOf(os.StartProcess),
		"Stat":                reflect.ValueOf(os.Stat),
		"Stderr":              reflect.ValueOf(&os.Stderr).Elem(),
		"Stdin":               reflect.ValueOf(&os.Stdin).Elem(),
		"Stdout":              reflect.ValueOf(&os.Stdout).Elem(),
		"Symlink":             reflect.ValueOf(os.Symlink),
		"TempDir":             reflect.ValueOf(os.TempDir),
		"Truncate":            reflect.ValueOf(os.Truncate),
		"Unsetenv":            reflect.ValueOf(os.Unsetenv),
		"UserCacheDir":        reflect.ValueOf(os.UserCacheDir),
		"UserConfigDir":       reflect.ValueOf(os.UserConfigDir),
		"UserHomeDir":         reflect.ValueOf(os.UserHomeDir),
		"WriteFile":           reflect.ValueOf(os.WriteFile),

		// type definitions
		"DirEntry":     reflect.ValueOf((*os.DirEntry)(nil)),
		"File":         reflect.ValueOf((*os.File)(nil)),
		"FileInfo":     reflect.ValueOf((*os.FileInfo)(nil)),
		"FileMode":     reflect.ValueOf((*os.FileMode)(nil)),
		"LinkError":    reflect.ValueOf((*os.LinkError)(nil)),
		"PathError":    reflect.ValueOf((*os.PathError)(nil)),
		"ProcAttr":     reflect.ValueOf((*os.ProcAttr)(nil)),
		"Process":      reflect.ValueOf((*os.Process)(nil)),
		"ProcessState": reflect.ValueOf((*os.ProcessState)(nil)),
		"Signal":       reflect.ValueOf((*os.Signal)(nil)),
		"SyscallError": reflect.ValueOf((*os.SyscallError)(nil)),

		// interface wrapper definitions
		"_DirEntry": reflect.ValueOf((*_os_DirEntry)(nil)),
		"_FileInfo": reflect.ValueOf((*_os_FileInfo)(nil)),
		"_Signal":   reflect.ValueOf((*_os_Signal)(nil)),
	}
}

// _os_DirEntry is an interface wrapper for DirEntry type
type _os_DirEntry struct {
	IValue interface{}
	WInfo  func() (fs.FileInfo, error)
	WIsDir func() bool
	WName  func() string
	WType  func() fs.FileMode
}

func (W _os_DirEntry) Info() (fs.FileInfo, error) {
	return W.WInfo()
}
func (W _os_DirEntry) IsDir() bool {
	return W.WIsDir()
}
func (W _os_DirEntry) Name() string {
	return W.WName()
}
func (W _os_DirEntry) Type() fs.FileMode {
	return W.WType()
}

// _os_FileInfo is an interface wrapper for FileInfo type
type _os_FileInfo struct {
	IValue   interface{}
	WIsDir   func() bool
	WModTime func() time.Time
	WMode    func() fs.FileMode
	WName    func() string
	WSize    func() int64
	WSys     func() any
}

func (W _os_FileInfo) IsDir() bool {
	return W.WIsDir()
}
func (W _os_FileInfo) ModTime() time.Time {
	return W.WModTime()
}
func (W _os_FileInfo) Mode() fs.FileMode {
	return W.WMode()
}
func (W _os_FileInfo) Name() string {
	return W.WName()
}
func (W _os_FileInfo) Size() int64 {
	return W.WSize()
}
func (W _os_FileInfo) Sys() any {
	return W.WSys()
}

// _os_Signal is an interface wrapper for Signal type
type _os_Signal struct {
	IValue  interface{}
	WSignal func()
	WString func() string
}

func (W _os_Signal) Signal() {
	W.WSignal()
}
func (W _os_Signal) String() string {
	if W.WString == nil {
		return ""
	}
	return W.WString()
}