Hey guys, I am aware that loads of you have been looking for a way to extract archives with Corona for a long time now.
I am planning on implementing more archive support for corona in C/objective c but more info on that later.
So for now, here is a solution done in pure lua.
From benchmarking it took 1.3 seconds to extract a 10mb tar archive.
I created the test tar archive using a mac app named “betterZip” however any archiving tool should be able to do this for you.
Notes :
- It only supports uncompressed tar archives (.tar).
- It doesn’t support folders inside the archive.
So it won’t save you space, but it will help you break past app size barrier limits. For instance the 50mb limit on the android market can be overcome by downloading your assets individually from a server. Obviously if you have thousands of images this is going to be tiresome, so this way you can pack them into one file and download that single file and extract it where it’s needed.
The sample includes the tar module and also a sample demonstrating how to use it (just one line of code )
Enjoy
Update :
Changes :
- Minor optimizations, even faster extraction
- Added a onComplete handler that you can pass a function to upon successful extraction of the archive.
http://www.infuseddreams.com/apps/Tar_Lib.zip
[import]uid: 84637 topic_id: 23242 reply_id: 323242[/import]