3.3 Extracting files

Since xad.hwp can hook 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.rar, just use the following line:

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

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

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

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

Show TOC