3.3 Extracting files

Since zip.hwp hooks into Hollywood's file handler, extracting files is just a matter of using Hollywood's CopyFile() function on the file you wish to extract. For example, to extract a file named testpicture.jpg from test.zip, just use the following line:

 
CopyFile("test.zip/testpicture.jpg", "outputdir")

Since CopyFile() can also copy whole directories including all subdirectories and because zip.hwp hooks into Hollywood's directory handler as well, it is even possible to extract a whole archive using CopyFile(), like this:

 
CopyFile("test.zip", "outputdir")

This, however, will be pretty slow because zip.hwp will open and close the zip archive for every single file that needs to be extracted which is of course a performance killer. That's why zip.hwp also offers a dedicated function to extract files for fine-tuned control over zip archives. See zip.ExtractFile for details.


Show TOC