-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrno.go
More file actions
175 lines (166 loc) · 4.27 KB
/
Copy patherrno.go
File metadata and controls
175 lines (166 loc) · 4.27 KB
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
package errnov1
type Code int
const (
OK Code = 0 // Success
// Basic err codes
EPERM Code = 1 // Operation not permitted
ENOENT Code = 2 // No such file or directory
ESRCH Code = 3 // No such process
EINTR Code = 4 // Interrupted system call
EIO Code = 5 // I/O error
ENXIO Code = 6 // No such device or address
E2BIG Code = 7 // Argument list too long
ENOEXEC Code = 8 // Exec format error
EBADF Code = 9 // Bad file number
ECHILD Code = 10 // No child processes
EAGAIN Code = 11 // Try again
ENOMEM Code = 12 // Out of memory
EACCES Code = 13 // Permission denied
EFAULT Code = 14 // Bad address
ENOTBLK Code = 15 // Block device required
EBUSY Code = 16 // Device or resource busy
EEXIST Code = 17 // File exists
EXDEV Code = 18 // Cross-device link
ENODEV Code = 19 // No such device
ENOTDIR Code = 20 // Not a directory
EISDIR Code = 21 // Is a directory
EINVAL Code = 22 // Invalid argument
ENFILE Code = 23 // File table overflow
EMFILE Code = 24 // Too many open files
ENOTTY Code = 25 // Not a typewriter
ETXTBSY Code = 26 // Text file busy
EFBIG Code = 27 // File too large
ENOSPC Code = 28 // No space left on device
ESPIPE Code = 29 // Illegal seek
EROFS Code = 30 // Read-only file system
EMLINK Code = 31 // Too many links
EPIPE Code = 32 // Broken pipe
EDOM Code = 33 // Math argument out of domain
ERANGE Code = 34 // Math result not representable
// Additional err codes
EDEADLK Code = 35 // Resource deadlock avoided
ENAMETOOLONG Code = 36 // File name too long
ENOLCK Code = 37 // No locks available
ENOSYS Code = 38 // Function not implemented
ENOTEMPTY Code = 39 // Directory not empty
ELOOP Code = 40 // Too many symbolic links
ENOMSG Code = 42 // No message of desired type
EIDRM Code = 43 // Identifier removed
ENOTFOUND Code = 44 // Not found
// Specific err codes
ECOMP Code = 70 // Component error
EENTITY Code = 71 // Entity error
ESYSTEM Code = 72 // System error
ECALL Code = 73 // Call error
)
func SUCCESS(v Code) bool {
return v == OK
}
func FAIL(v Code) bool {
return v != OK
}
func (x Code) Int() int {
return (int)(x)
}
func (x Code) String() string {
switch x {
case OK:
return "Success"
case EPERM:
return "Operation not permitted"
case ENOENT:
return "No such file or directory"
case ESRCH:
return "No such process"
case EINTR:
return "Interrupted system call"
case EIO:
return "I/O error"
case ENXIO:
return "No such device or address"
case E2BIG:
return "Argument list too long"
case ENOEXEC:
return "Exec format error"
case EBADF:
return "Bad file number"
case ECHILD:
return "No child processes"
case EAGAIN:
return "Try again"
case ENOMEM:
return "Out of memory"
case EACCES:
return "Permission denied"
case EFAULT:
return "Bad address"
case ENOTBLK:
return "Block device required"
case EBUSY:
return "Device or resource busy"
case EEXIST:
return "File exists"
case EXDEV:
return "Cross-device link"
case ENODEV:
return "No such device"
case ENOTDIR:
return "Not a directory"
case EISDIR:
return "Is a directory"
case EINVAL:
return "Invalid argument"
case ENFILE:
return "File table overflow"
case EMFILE:
return "Too many open files"
case ENOTTY:
return "Not a typewriter"
case ETXTBSY:
return "Text file busy"
case EFBIG:
return "File too large"
case ENOSPC:
return "No space left on device"
case ESPIPE:
return "Illegal seek"
case EROFS:
return "Read-only file system"
case EMLINK:
return "Too many links"
case EPIPE:
return "Broken pipe"
case EDOM:
return "Math argument out of domain"
case ERANGE:
return "Math result not representable"
case EDEADLK:
return "Resource deadlock avoided"
case ENAMETOOLONG:
return "File name too long"
case ENOLCK:
return "No locks available"
case ENOSYS:
return "Function not implemented"
case ENOTEMPTY:
return "Directory not empty"
case ELOOP:
return "Too many symbolic links"
case ENOMSG:
return "No message of desired type"
case EIDRM:
return "Identifier removed"
case ENOTFOUND:
return "Not found"
case ECOMP:
return "Component error"
case EENTITY:
return "Entity error"
case ESYSTEM:
return "System error"
case ECALL:
return "Call error"
default:
return "Unknown error"
}
}