@@ -105,6 +105,12 @@ pub enum ErrorKind {
105105 /// The connection was reset by the remote server.
106106 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
107107 ConnectionReset ,
108+ /// The remote host is not reachable.
109+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
110+ HostUnreachable ,
111+ /// The network containing the remote host is not reachable.
112+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
113+ NetworkUnreachable ,
108114 /// The connection was aborted (terminated) by the remote server.
109115 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
110116 ConnectionAborted ,
@@ -119,6 +125,9 @@ pub enum ErrorKind {
119125 /// local.
120126 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
121127 AddrNotAvailable ,
128+ /// The system's networking is down.
129+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
130+ NetworkDown ,
122131 /// The operation failed because a pipe was closed.
123132 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
124133 BrokenPipe ,
@@ -129,6 +138,37 @@ pub enum ErrorKind {
129138 /// requested to not occur.
130139 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
131140 WouldBlock ,
141+ /// A filesystem object is, unexpectedly, not a directory.
142+ ///
143+ /// For example, a filesystem path was specified where one of the intermediate directory
144+ /// components was, in fact, a plain file.
145+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
146+ NotADirectory ,
147+ /// The filesystem object is, unexpectedly, a directory.
148+ ///
149+ /// A directory was specified when a non-directory was expected.
150+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
151+ IsADirectory ,
152+ /// A non-empty directory was specified where an empty directory was expected.
153+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
154+ DirectoryNotEmpty ,
155+ /// The filesystem or storage medium is read-only, but a write operation was attempted.
156+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
157+ ReadOnlyFilesystem ,
158+ /// Loop in the filesystem; often, too many levels of symbolic links.
159+ ///
160+ /// There was a loop (or excessively long chain) resolving a filesystem object.
161+ ///
162+ /// On Unix this is usually the result of a symbolic link loop; or, of exceeding the
163+ /// system-specific limit on the depth of symlink traversal.
164+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
165+ FilesystemLoop ,
166+ /// Stale network file handle
167+ ///
168+ /// With some network filesystems, notably NFS, an open file (or directory) can be invalidated
169+ /// by problems with the network or server.
170+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
171+ StaleNetworkFileHandle ,
132172 /// A parameter was incorrect.
133173 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
134174 InvalidInput ,
@@ -158,6 +198,62 @@ pub enum ErrorKind {
158198 /// [`Ok(0)`]: Ok
159199 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
160200 WriteZero ,
201+ /// The underlying storage (typically, a filesystem) is full.
202+ ///
203+ /// This does not include out of quota errors.
204+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
205+ StorageFull ,
206+ /// Seek on unseekable file
207+ ///
208+ /// Seeking was attempted on an open file handle which is not suitable for seeking - for
209+ /// example, on Unix, a named pipe opened with `File::new`.
210+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
211+ NotSeekable ,
212+ /// Filesystem quota was exceeded.
213+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
214+ FilesystemQuotaExceeded ,
215+ /// File larger than allowed or supported.
216+ ///
217+ /// This might arise from a hard limit of the underlying filesystem or file access API, or from
218+ /// an administratively imposed resource limitation. Simple disk full, and out of quota, have
219+ /// their own errors.
220+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
221+ FileTooLarge ,
222+ /// Resource is busy.
223+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
224+ ResourceBusy ,
225+ /// Executable file is busy.
226+ ///
227+ /// An attempt was made to write to a file which is also in use as a running program. (Not all
228+ /// operating systems detect this situation.)
229+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
230+ ExecutableFileBusy ,
231+ /// Deadlock (avoided)
232+ ///
233+ /// A file locking operation would result in deadlock. This situation is typically detected, if
234+ /// at all, on a best-effort basis.
235+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
236+ Deadlock ,
237+ /// Cross-device or cross-filesystem (hard) link or rename.
238+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
239+ CrossesDevices ,
240+ /// Too many (hard) links to the same filesystem object.
241+ ///
242+ /// The filesystem does not support making so many hardlinks to the same file.
243+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
244+ TooManyLinks ,
245+ /// Filename too long.
246+ ///
247+ /// The limit might be from the underlying filesystem or API, or an administratively imposed
248+ /// resource limit.
249+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
250+ FilenameTooLong ,
251+ /// Program argument list too long.
252+ ///
253+ /// When trying to run an external program, a system or process limit on the size of the
254+ /// arguments would have been exceeded.
255+ #[ unstable( feature = "io_error_more" , issue = "86442" ) ]
256+ ArgumentListTooLong ,
161257 /// This operation was interrupted.
162258 ///
163259 /// Interrupted operations can typically be retried.
@@ -213,19 +309,39 @@ impl ErrorKind {
213309 AddrInUse => "address in use" ,
214310 AddrNotAvailable => "address not available" ,
215311 AlreadyExists => "entity already exists" ,
312+ ArgumentListTooLong => "argument list too long" ,
216313 BrokenPipe => "broken pipe" ,
314+ ResourceBusy => "resource busy" ,
217315 ConnectionAborted => "connection aborted" ,
218316 ConnectionRefused => "connection refused" ,
219317 ConnectionReset => "connection reset" ,
318+ CrossesDevices => "cross-device link or rename" ,
319+ Deadlock => "deadlock" ,
320+ DirectoryNotEmpty => "directory not empty" ,
321+ ExecutableFileBusy => "executable file busy" ,
322+ FilenameTooLong => "filename too long" ,
323+ FilesystemQuotaExceeded => "filesystem quota exceeded" ,
324+ FileTooLarge => "file too large" ,
325+ HostUnreachable => "host unreachable" ,
220326 Interrupted => "operation interrupted" ,
221327 InvalidData => "invalid data" ,
222328 InvalidInput => "invalid input parameter" ,
329+ IsADirectory => "is a directory" ,
330+ NetworkDown => "network down" ,
331+ NetworkUnreachable => "network unreachable" ,
332+ NotADirectory => "not a directory" ,
333+ StorageFull => "no storage space" ,
223334 NotConnected => "not connected" ,
224335 NotFound => "entity not found" ,
225336 Other => "other error" ,
226337 OutOfMemory => "out of memory" ,
227338 PermissionDenied => "permission denied" ,
339+ ReadOnlyFilesystem => "read-only filesystem or storage medium" ,
340+ StaleNetworkFileHandle => "stale network file handle" ,
341+ FilesystemLoop => "filesystem loop (e.g. symbolic link loop)" ,
342+ NotSeekable => "seek on unseekable file" ,
228343 TimedOut => "timed out" ,
344+ TooManyLinks => "too many links" ,
229345 Uncategorized => "uncategorized error" ,
230346 UnexpectedEof => "unexpected end of file" ,
231347 Unsupported => "unsupported" ,
0 commit comments