std.fs.File.end: account for streaming mode

This commit is contained in:
Andrew Kelley 2025-07-25 13:54:46 -07:00
parent 7f43f78b5b
commit da51e94d50

View File

@ -2026,7 +2026,16 @@ pub const Writer = struct {
/// along with other write failures.
pub fn end(w: *Writer) EndError!void {
try w.interface.flush();
return w.file.setEndPos(w.pos);
switch (w.mode) {
.positional,
.positional_reading,
=> try w.file.setEndPos(w.pos),
.streaming,
.streaming_reading,
.failure,
=> {},
}
}
};