Corona Zip/Unzip

Can you please look at implementing internal zip/unzip functionality? It would be really useful to be able to download a package with content updates in a single file and then decompress locally. This would go a long way to making Corona apps more network reliant.

I’ve been through Lua Wiki for compression. Most of the projects listed as pure Lua implementations are not - they rely on C binaries or source or just execute “unzip” from the command line.

Module Compress Deflate is the only one in pure lua but it only decompresses gzip, so it’s of no use if you want to package multiple files.

If anyone knows of a pure lua unzip/unrar/untar implementation that they’ve used please do share… [import]uid: 11393 topic_id: 4886 reply_id: 304886[/import]

I second that request!

While I realize that Corona may have been originally developed for games, any more general purpose or business app will often need to download data. Due to the obvious limitations of these mobile devices, it’s vastly better to compress the data before sending it down the pipe.

Thanks, Steve [import]uid: 23379 topic_id: 4886 reply_id: 23335[/import]

+1 [import]uid: 56251 topic_id: 4886 reply_id: 34582[/import]

+1

I believe this claims to be a pure lua compression/decompression lib. I haven’t tried it with Corona.

http://lua-users.org/wiki/ModuleCompressDeflateLua

[import]uid: 4596 topic_id: 4886 reply_id: 35316[/import]

+1 [import]uid: 45445 topic_id: 4886 reply_id: 37777[/import]

+1 [import]uid: 63691 topic_id: 4886 reply_id: 37864[/import]

@Ansca: There seems to be much interest in local zip/unzip. Any official word on whether or not you’re looking at it or if it is possible? [import]uid: 11393 topic_id: 4886 reply_id: 39569[/import]

+1 this could’ve been really useful for a feature i was working on [import]uid: 8782 topic_id: 4886 reply_id: 39799[/import]

+10 Pretty please. [import]uid: 60730 topic_id: 4886 reply_id: 40889[/import]

+1 [import]uid: 16709 topic_id: 4886 reply_id: 42177[/import]

add it to my roadmap at

www.anscamobile.com/corona/roadmap

c [import]uid: 24 topic_id: 4886 reply_id: 42183[/import]

Added. [import]uid: 60730 topic_id: 4886 reply_id: 42194[/import]

saw it

woot

c [import]uid: 24 topic_id: 4886 reply_id: 42196[/import]

+1

very important. i am waiting for a zip function, i need it so i can finish one of my projects. i have tried many different things to resolve this on my own but i haven’t been able to figure it out.

there is lots of documentation on this for lua, and should be very easy for the skilled team at anscamobile to implement it in a matter of hours.

thx anscamobile [import]uid: 89663 topic_id: 4886 reply_id: 84307[/import]

Actually this would be useful in implementing Newsstand apps.
[import]uid: 19626 topic_id: 4886 reply_id: 84309[/import]

There is a pure lua implementation of untar via the luarocks project:

https://github.com/keplerproject/luarocks/blob/master/src/luarocks/tools/tar.lua

I haven’t tried it personally, so would also like to know if it is deemed suitable for a corona built app.

Regardless, add another +1 for zip/unzip functionality. [import]uid: 25010 topic_id: 4886 reply_id: 90725[/import]

I created a module (based on lua rocks) to extract tar archives in corona. See here : http://developer.anscamobile.com/forum/2012/03/13/tar-module-extract-tar-files-corona [import]uid: 84637 topic_id: 4886 reply_id: 93038[/import]

very important. i am waiting for a zip function, i need it so i can finish one of my projects.

What does your data look like?
There are simple ways to achieve compression that don’t rely on the LZH methodology.

For my own files, I realised that much of the data was actually empty space.
A simple change to the storage method got that down to a byte for ‘empty’ as opposed to 16 bytes for ‘populated’
File size came down from 500K to 20K in many cases.

I once used 2byte lookups for common words or phrases to implement an adventure game: getting the text down from Mb to Kb.

So it may just take a look with different eyes… [import]uid: 108660 topic_id: 4886 reply_id: 93062[/import]

http://developer.anscamobile.com/forum/2012/03/13/tar-module-extract-tar-files-corona

this works well, its a good solution thx kfiller and Danny for taking the time to find this and implementing it :wink: [import]uid: 89663 topic_id: 4886 reply_id: 93150[/import]

@jeff472 thx for the response.

mine has nothing to do about file sizes but downloading an updating my ad module. before i just download a json file then go through it to download small-icons, large-icons, banners ect. i mostly wanted to bundle things together and download one file instead of 30 small files. i just assumed zipping them would be the easiest.

you are very much correct when you say ‘look with different eyes’ especially in programming there are so many ways to do one thing.

thx for the tips [import]uid: 89663 topic_id: 4886 reply_id: 93152[/import]