We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f43f78 commit da51e94Copy full SHA for da51e94
lib/std/fs/File.zig
@@ -2026,7 +2026,16 @@ pub const Writer = struct {
2026
/// along with other write failures.
2027
pub fn end(w: *Writer) EndError!void {
2028
try w.interface.flush();
2029
- return w.file.setEndPos(w.pos);
+ switch (w.mode) {
2030
+ .positional,
2031
+ .positional_reading,
2032
+ => try w.file.setEndPos(w.pos),
2033
+
2034
+ .streaming,
2035
+ .streaming_reading,
2036
+ .failure,
2037
+ => {},
2038
+ }
2039
}
2040
};
2041
0 commit comments