Reading and creating .zip files

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Darkwater
Prole
Posts: 4
Joined: Wed Nov 09, 2011 2:38 pm

Reading and creating .zip files

Post by Darkwater »

Is this possible?
If no, can I download a library for it? (If yes, where would I put the .dll?)
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Reading and creating .zip files

Post 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.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Darkwater
Prole
Posts: 4
Joined: Wed Nov 09, 2011 2:38 pm

Re: Reading and creating .zip files

Post 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.
Darkwater
Prole
Posts: 4
Joined: Wed Nov 09, 2011 2:38 pm

Re: Reading and creating .zip files

Post by Darkwater »

Can we possibly get this in the next version of Love?
User avatar
ncarlson
Prole
Posts: 35
Joined: Wed Jul 20, 2011 4:00 pm

Re: Reading and creating .zip files

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

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot] and 8 guests