Last update January 22, 2007

Doc Comments / Phobos /
Std Zip



std.zip

Comments

Add your comments here...

Too bad it isn't stream-based

It's a real bummer that this library isn't stream based. For example, in order to create a zip file, it's important to be able to stream data through the library instead of storing everything in memory. Take a look at the Java implementation of the Zip format for an example of a decent way to do things.

Support for zip decryption

The attached file contains myzip.d, which is exactly the same as std.zip, except that the ZipArchive.expand() function no longer throws an exception if it finds an encrypted file, and it has an extra optional parameter - a char[] for the password. So to decrypt a file, you'd do something like..

 ubyte[] data=zip.expand(zip.directory["test.txt"],"qwe");
Where "qwe" is the password. Note that because of the way zip encryption works, there is not necessarily a "right" or "wrong" password - use the wrong password, and it'll decrypt the file into nonsensical garbage.

There is another file in the attached zip called message.txt. Try extracting it using the new expand() function with the password "walter".

(from NG:digitalmars.D/14131)

Links

Corresponding page in the D Specification

FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: January 22, 2007 18:54 (diff))