aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Io/File
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-12-05 17:41:27 -0800
committerAndrew Kelley <andrew@ziglang.org>2025-12-23 22:15:07 -0800
commit72b76077ab4e5042b13ea311063f2c7e867e00ba (patch)
treebda79bf0b7899c4ebdc514ff1c1a2cfd03f81563 /lib/std/Io/File
parentba999d608c304c37667175b35e4a64f87d90351c (diff)
downloadzig-72b76077ab4e5042b13ea311063f2c7e867e00ba.tar.gz
zig-72b76077ab4e5042b13ea311063f2c7e867e00ba.zip
std: fix some surface level compilation errors
And boldly remove preadv, pwritev, readv, writev, pread, pwrite from std.posix.
Diffstat (limited to 'lib/std/Io/File')
-rw-r--r--lib/std/Io/File/Writer.zig25
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/std/Io/File/Writer.zig b/lib/std/Io/File/Writer.zig
index bb141f9ef6..e511e62e19 100644
--- a/lib/std/Io/File/Writer.zig
+++ b/lib/std/Io/File/Writer.zig
@@ -7,7 +7,7 @@ const assert = std.debug.assert;
io: Io,
file: File,
-err: ?File.WriteError = null,
+err: ?Error = null,
mode: Mode = .positional,
/// Tracks the true seek position in the file. To obtain the logical
/// position, add the buffer size to this value.
@@ -18,6 +18,29 @@ interface: Io.Writer,
pub const Mode = File.Reader.Mode;
+pub const Error = error{
+ DiskQuota,
+ FileTooBig,
+ InputOutput,
+ NoSpaceLeft,
+ DeviceBusy,
+ InvalidArgument,
+ /// File descriptor does not hold the required rights to write to it.
+ AccessDenied,
+ PermissionDenied,
+ BrokenPipe,
+ SystemResources,
+ NotOpenForWriting,
+ /// The process cannot access the file because another process has locked
+ /// a portion of the file. Windows-only.
+ LockViolation,
+ /// Non-blocking has been enabled and this operation would block.
+ WouldBlock,
+ /// 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.
+ NoDevice,
+} || Io.Cancelable || Io.UnexpectedError;
+
pub const WriteFileError = error{
/// `out_fd` is an unconnected socket, or out_fd closed its read end.
BrokenPipe,