Function extract [src]

Extract the zipped files inside seekable_stream to the given dest directory. Note that seekable_stream must be an instance of std.io.SeekableStream and its context must also have a .reader() method that returns an instance of std.io.Reader.

Prototype

pub fn extract(dest: std.fs.Dir, seekable_stream: anytype, options: ExtractOptions) !void

Parameters

dest: std.fs.Diroptions: ExtractOptions

Source

pub fn extract(dest: std.fs.Dir, seekable_stream: anytype, options: ExtractOptions) !void { const SeekableStream = @TypeOf(seekable_stream); var iter = try Iterator(SeekableStream).init(seekable_stream); var filename_buf: [std.fs.max_path_bytes]u8 = undefined; while (try iter.next()) |entry| { const crc32 = try entry.extract(seekable_stream, options, &filename_buf, dest); if (crc32 != entry.crc32) return error.ZipCrcMismatch; if (options.diagnostics) |d| { try d.nextFilename(filename_buf[0..entry.filename_len]); } } }