Error Set CopyFileError [src]
Errors
In WASI, this error may occur when the file descriptor does not hold the required rights to open a new resource relative to it.
On Windows, antivirus software is enabled by default. It can be disabled, but Windows Update sometimes ignores the user's preference and re-enables it. When enabled, antivirus software on Windows intercepts file system operations and makes them significantly slower in addition to possibly failing with this error code.
On Windows, file paths cannot contain these characters: '/', '*', '?', '"', '<', '>', '|'
The local end has been shut down on a connection oriented socket. In this case, the process will also receive a SIGPIPE unless MSG.NOSIGNAL is set.
reading a timerfd with CANCEL_ON_SET will lead to this error when the clock goes through a discontinuous change
Connection reset by peer.
Another Fast Open is already in progress.
One of these three things:
- pathname refers to an executable image which is currently being executed and write access was requested.
- pathname refers to a file that is currently in use as a swap file, and the O_TRUNC flag was specified.
- pathname refers to a file that is currently being read by the kernel (e.g., for module/firmware loading), and write access was requested.
The underlying filesystem does not support file locks
Either:
- One of the path components does not exist.
- Cwd was used, but cwd has been deleted.
- The path associated with the open directory handle has been deleted.
- On macOS, multiple processes or threads raced to create the same file
with
O.EXCL
set tofalse
.
The file is too large to be opened. This error is unreachable for 64-bit targets, as well as when opening directories.
fd_in
is not open for reading; or fd_out
is not open for writing;
or the APPEND
flag is set for fd_out
.
WASI-only; file paths must be valid UTF-8.
Windows-only; file paths provided by the user must be valid WTF-8. https://simonsapin.github.io/wtf-8/
The path refers to directory but the DIRECTORY
flag was not provided.
Unable to read file due to lock.
The socket type requires that message be sent atomically, and the size of the message to be sent made this impossible. The message is not transmitted.
The path exceeded max_path_bytes
bytes.
On Windows, \\server
or \\server\share
was not found.
The local network interface used to reach the destination is down.
Network is unreachable.
This error occurs when a device gets disconnected before or mid-flush while it's being written to - errno(6): No such device or address.
A new path cannot be created because the device has no room for the new file.
This error is only reachable when the CREAT
flag is provided.
A component used as a directory in the path was not, in fact, a directory, or
DIRECTORY
was specified and the path was not a directory.
The path already exists and the CREAT
and EXCL
flags were provided.
This error occurs in Linux if the process to be read from no longer exists.
Insufficient kernel memory was available, or the named file is a FIFO and per-user hard limit on memory allocation for pipes has been reached.
The Operating System returned an undocumented error code.
This error is in theory not possible, but it would be better to handle this error than to invoke undefined behavior.
When this error code is observed, it usually means the Zig Standard Library needs a small patch to add the error code to the error set for the respective function.
This error occurs when no global event loop is configured, and reading from the file descriptor would block.
Source
pub const CopyFileError = File.OpenError || File.StatError ||
AtomicFile.InitError || CopyFileRawError || AtomicFile.FinishError