I am working on a app which must unarchive zip and rar files. I would like to ask which method should I follow.
- Should I use xadmaster to unarchive these files? If yes, except the xadmaster includes at os4depot (http://is.gd/VRkNC1) should I use something else? Are there any examples available?
- For zip files I could use libzip from os4depot (http://is.gd/igFc4D). is there any equivalent for rar files?
- Use system commands like unzip or unrar?
The app will run on AmigaOS 4 with Reaction. Any proposal would be really helpful. Thanks for your time guys.
If xad supports all archive types you require (and more which you might require in future), then you should go that route. It is the AmigaOS standard. Check xadmasterdev archive on Aminet for examples.
Running external commands is a bad idea unless you deliver exactly the needed versions of the commands with your program. Otherwise it is prone to fail because every user can have a different version of each command which needs a different set of command line options or give a different result.
Using libzip "from os4depot" it not a good idea, too, because the old version will rot on os4depot once the uploader/porter loses interest. You should rather take the current version of libzip and port it yourself, then you can update it whenever you update your program. Usually it is only a matter of running configure and make.
However, you should not forget that using GPLed code in your program automatically makes your code GPL, too.
I use libzip for manipulating my SketchBlock save format (which is a zipped archive of xml and binary data)
I chose it because it allows to browse the archive without unarchiving to any temporary file, and lha etc didn't offer this as far as my reserach could tell at anyrate.
libzip is not GPL BTW
@walkero
There is unrarlib but it only works with RAR 2.0 archives and not with newer RAR 3.x archives:
http://os4depot.net/index.php?function=showfile&file=development/library/misc/unrarlib.lha
@thomas
Just uploaded an updated port of libzip (latest 1.0.1 version) to my own website:
http://www.a500.org/downloads/development/libzip_7z.readme
The license of libzip is BSD and not GPL BTW.
@salass00
Thank you!!!
@broadblues
That's the bit I like about libzip, too.
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
Thanks guys for your fast replies and your kind recommendations. I am thinking to try with xadmaster, because it can be extended supporting newer versions of archives, or different kinds, lik 7z, without me doing anything. I do not need to see the archived file list in my project, just unzip the files before show them into the app. In case it doesn't work I may try libzip.
Thanks again all of you.
Hello again. Can someone confirm if the xadmaster's necessary files are included in SDK, or do I have to add them from an archive, like the following http://is.gd/VRkNC1 ?