Function writeFileStream [src]

Writes file reading file content from reader. Reads exactly size bytes from reader, or returns error.EndOfStream.

Prototype

pub fn writeFileStream( w: *Writer, sub_path: []const u8, size: u64, reader: *std.Io.Reader, options: Options, ) WriteFileStreamError!void

Parameters

w: *Writersub_path: []const u8size: u64reader: *std.Io.Readeroptions: Options

Possible Errors

EndOfStream StreamError

End of stream indicated from the Reader. This error cannot originate from the Writer.

NameTooLong Error
OctalOverflow Error
ReadFailed StreamError

See the Reader implementation for detailed diagnostics.

WriteFailed StreamError

See the Writer implementation for detailed diagnostics.

Source

pub fn writeFileStream( w: *Writer, sub_path: []const u8, size: u64, reader: *std.Io.Reader, options: Options, ) WriteFileStreamError!void { try w.writeHeader(.regular, sub_path, "", size, options); try reader.streamExact64(w.underlying_writer, size); try w.writePadding64(size); }