pub fn end(w: *Writer) EndError!void
Flushes any buffered data and sets the end position of the file.
If not overwriting existing contents, then calling interface.flush directly is sufficient.
interface.flush
Flush failure is handled by setting err so that it can be handled along with other write failures.
err
w: *Writer
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
pub fn end(w: *Writer) EndError!void { const io = w.io; try w.interface.flush(); switch (w.mode) { .positional, .positional_simple, => w.file.setLength(io, w.pos) catch |err| switch (err) { error.NonResizable => return, else => |e| return e, }, .streaming, .streaming_simple, .failure, => {}, } }
Flushes any buffered data and sets the end position of the file.
If not overwriting existing contents, then calling
interface.flushdirectly is sufficient.Flush failure is handled by setting
errso that it can be handled along with other write failures.