Page 1 of 1

Reading and creating .zip files

Posted: Wed Nov 09, 2011 2:44 pm
by Darkwater
Is this possible?
If no, can I download a library for it? (If yes, where would I put the .dll?)

Re: Reading and creating .zip files

Posted: Wed Nov 09, 2011 3:30 pm
by Taehl
Not possible in vanilla Love, no. If you do get a library for it (all standard Lua libraries work in Love), it would need to go in the Love2D folder (and not inside your game). Just remember: If you distribute your game with a library, it gets a lot harder to make sure it works cross-platform.

An alternative is to use a zipping library written in pure Lua. I've made a humble attempt at that.

Re: Reading and creating .zip files

Posted: Wed Nov 09, 2011 8:32 pm
by Darkwater
Ive tried to use LuaZip.
Ive put the zip.dll in Program Files/Love/ but when I require it from Lua, I get an error telling me it cant find lua5.1.dll.

For the pure Lua lib, I guess that doesnt read .zip files, but compressed zip strings, right?

What I want is to get a .zip file, open it and extract its contents to a folder for later use.

Re: Reading and creating .zip files

Posted: Sun Nov 13, 2011 10:35 am
by Darkwater
Can we possibly get this in the next version of Love?

Re: Reading and creating .zip files

Posted: Mon Nov 21, 2011 11:12 pm
by ncarlson
Darkwater wrote:Is this possible?
If no, can I download a library for it? (If yes, where would I put the .dll?)
Love doesn't have a built-in api for handling zip files. However, Love provides all of the file-system functionality to allow writing and reading of disk data.

If you're up for the challenge, you could write a pure lua-based zip compressor and deflator.