Corona Zip/Unzip

20 replies [Last post]
bedhouin
User offline. Last seen 5 days 17 hours ago. Offline
Joined: 15 Nov 2010

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

Replies

stevepodradchik
User offline. Last seen 1 year 3 weeks ago. Offline
Joined: 20 Jan 2011

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

sfrechette
User offline. Last seen 17 weeks 5 days ago. Offline
Joined: 28 Apr 2011

+1

coderebelbase's picture
coderebelbase
User offline. Last seen 3 weeks 2 days ago. Offline
Joined: 1 Feb 2010

+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

bruno.simoes7
User offline. Last seen 11 hours 15 min ago. Offline
Joined: 15 Mar 2011

+1

nick.dufresne
User offline. Last seen 40 weeks 4 days ago. Offline
Joined: 23 May 2011

+1

bedhouin
User offline. Last seen 5 days 17 hours ago. Offline
Joined: 15 Nov 2010

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

NayGames's picture
NayGames
User offline. Last seen 2 days 20 hours ago. Offline
Joined: 8 Sep 2010

+1 this could've been really useful for a feature i was working on

ctran
User offline. Last seen 20 weeks 5 days ago. Offline
Joined: 14 May 2011

+10 Pretty please.

kang
User offline. Last seen 5 weeks 3 days ago. Offline
Joined: 17 Jan 2011

+1

carlos m. icaza's picture
carlos m. icaza
User offline. Last seen 6 weeks 5 days ago. Offline
Alumni
Joined: 22 Jun 2009

add it to my roadmap at

www.anscamobile.com/corona/roadmap

c

ctran
User offline. Last seen 20 weeks 5 days ago. Offline
Joined: 14 May 2011

Added.

carlos m. icaza's picture
carlos m. icaza
User offline. Last seen 6 weeks 5 days ago. Offline
Alumni
Joined: 22 Jun 2009

saw it

woot

c

ezraanderson1979's picture
ezraanderson1979
User offline. Last seen 1 week 3 days ago. Offline
Joined: 8 Sep 2011

+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

robmiracle's picture
robmiracle
User offline. Last seen 6 hours 16 min ago. Offline
Joined: 18 Jan 2011

Actually this would be useful in implementing Newsstand apps.

kfiller
User offline. Last seen 11 weeks 3 days ago. Offline
Joined: 22 Jan 2011

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.

Danny's picture
Danny
User offline. Last seen 38 min 42 sec ago. Offline
Staff
Joined: 17 Aug 2011

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

jeff472's picture
jeff472
User is online Online
Joined: 2 Dec 2011

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

ezraanderson1979's picture
ezraanderson1979
User offline. Last seen 1 week 3 days ago. Offline
Joined: 8 Sep 2011

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 ;)

ezraanderson1979's picture
ezraanderson1979
User offline. Last seen 1 week 3 days ago. Offline
Joined: 8 Sep 2011

@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

ezraanderson1979's picture
ezraanderson1979
User offline. Last seen 1 week 3 days ago. Offline
Joined: 8 Sep 2011

edit: misPost too many windows open suppose to be here

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

7-zip doesn't add 'ustar' to there header read source

http://sourceforge.net/projects/sevenzip/forums/forum/45797/topic/3686403

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.