= Unzip using std.zip = ''Part of'' StandardLibraryCategory == Description == Shows how to extract a file from a .zip archive. == Instructions == You'll need an archive called "test.zip". You can download a test.zip file that I've used (found on [http://jcc_7.tripod.com/d/tutor/library/zip.html this page]). == Example == {{{ #!d import std.file; import std.date; import std.stream; import std.zip; import std.zlib; int main(char[][] args) { File f; byte[] buffer; std.zip.ZipArchive zr; char[] zipname; if (args.length > 1) zipname = args[1]; else zipname = "test.zip"; buffer = cast(byte[])std.file.read(zipname); zr = new std.zip.ZipArchive(cast(void[])buffer); foreach (ArchiveMember de; zr.directory) { f = new File(de.name, FileMode.Out); zr.expand(de); f.write(de.expandedData); } printf("Success!\n"); return 0; } }}} == Source == Adapted from [http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=D&artnum=20379 Walter]'s zlib example.