file_streams/file_stream_error

Types

The reasons why a file stream operation can fail. Most of these map to underlying POSIX errors.

pub type FileStreamError {
  Eacces
  Eagain
  Ebadf
  Ebadmsg
  Ebusy
  Edeadlk
  Edeadlock
  Edquot
  Eexist
  Efault
  Efbig
  Eftype
  Eintr
  Einval
  Eio
  Eisdir
  Eloop
  Emfile
  Emlink
  Emultihop
  Enametoolong
  Enfile
  Enobufs
  Enodev
  Enolck
  Enolink
  Enoent
  Enomem
  Enospc
  Enosr
  Enostr
  Enosys
  Enotblk
  Enotdir
  Enotsup
  Enxio
  Eopnotsupp
  Eoverflow
  Eperm
  Epipe
  Erange
  Erofs
  Espipe
  Esrch
  Estale
  Etxtbsy
  Exdev
  Eof
  NoTranslation(from: TextEncoding, to: TextEncoding)
  InvalidUnicode
}

Constructors

  • Eacces

    Permission denied.

  • Eagain

    Resource temporarily unavailable.

  • Ebadf

    Bad file number

  • Ebadmsg

    Bad message.

  • Ebusy

    File busy.

  • Edeadlk

    Resource deadlock avoided.

  • Edeadlock

    On most architectures, same as Edeadlk. On some architectures, it

    means “File locking deadlock error.”

  • Edquot

    Disk quota exceeded.

  • Eexist

    File already exists.

  • Efault

    Bad address in system call argument.

  • Efbig

    File too large.

  • Eftype

    Inappropriate file type or format. Usually caused by trying to set the

    “sticky bit” on a regular file (not a directory).

  • Eintr

    Interrupted system call.

  • Einval

    Invalid argument.

  • Eio

    I/O error.

  • Eisdir

    Illegal operation on a directory.

  • Eloop

    Too many levels of symbolic links.

  • Emfile

    Too many open files.

  • Emlink

    Too many links.

  • Emultihop

    Multihop attempted.

  • Enametoolong

    Filename too long

  • Enfile

    File table overflow

  • Enobufs

    No buffer space available.

  • Enodev

    No such device.

  • Enolck

    No locks available.

  • Enolink

    Link has been severed.

  • Enoent

    No such file or directory.

  • Enomem

    Not enough memory.

  • Enospc

    No space left on device.

  • Enosr

    No STREAM resources.

  • Enostr

    Not a STREAM.

  • Enosys

    Function not implemented.

  • Enotblk

    Block device required.

  • Enotdir

    Not a directory.

  • Enotsup

    Operation not supported.

  • Enxio

    No such device or address.

  • Eopnotsupp

    Operation not supported on socket.

  • Eoverflow

    Value too large to be stored in data type.

  • Eperm

    Not owner.

  • Epipe

    Broken pipe.

  • Erange

    Result too large.

  • Erofs

    Read-only file system.

  • Espipe

    Invalid seek.

  • Esrch

    No such process.

  • Estale

    Stale remote file handle.

  • Etxtbsy

    Text file busy.

  • Exdev

    Cross-domain link.

  • Eof

    The end of the file stream was reached before the requested data could be read.

  • NoTranslation(from: TextEncoding, to: TextEncoding)

    Text data was encountered that can’t be converted from/to the relevant text encoding. E.g. trying to write Chinese characters to a file stream opened with the Latin1 encoding.

  • InvalidUnicode

    Data was encountered that is not valid Unicode. E.g. invalid bytes in a UTF-8 text file.

Functions

pub fn describe(error: FileStreamError) -> String

Returns a human-readable description of a file stream error.

Search Document