Unarchiving files

8 posts / 0 new
Last post
walkero
walkero's picture
Offline
Last seen: 3 months 3 days ago
Joined: 2009-05-03 16:54
Unarchiving files

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.

thomas
thomas's picture
Offline
Last seen: 1 day 9 hours ago
Joined: 2011-05-16 14:23
If xad supports all archive

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.

broadblues
broadblues's picture
Offline
Last seen: 4 years 1 month ago
Joined: 2012-05-02 21:48
I use libzip for manipulating

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

salass00
salass00's picture
Offline
Last seen: 1 year 1 month ago
Joined: 2011-02-03 11:27
@walkero There is unrarlib

@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

salass00
salass00's picture
Offline
Last seen: 1 year 1 month ago
Joined: 2011-02-03 11:27
@thomas Just uploaded an

@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.

trixie
trixie's picture
Offline
Last seen: 5 months 1 day ago
Joined: 2011-02-03 13:58
@salass00 Just uploaded an

@salass00

Just uploaded an updated port of libzip (latest 1.0.1 version)

Thank you!!!

@broadblues

I chose it because it allows to browse the archive without unarchiving to any temporary file

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

walkero
walkero's picture
Offline
Last seen: 3 months 3 days ago
Joined: 2009-05-03 16:54
Thanks guys for your fast

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.

walkero
walkero's picture
Offline
Last seen: 3 months 3 days ago
Joined: 2009-05-03 16:54
Hello again. Can someone

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 ?

Log in or register to post comments