• Forum
  • Lounge
  • Are there any good, simple to use zip li

 
Are there any good, simple to use zip libs?

Pages: 12
I need one that supports 4GB+ archives.
Not that I'm aware of. A couple years ago I wanted to give a program of mine ZIP support, and found that there was just no way to do that without implementing ZIP myself.
Irrlicht has a rather nice ZIP interface IIRC, so you might want to take a look at how they do it.
IIRC, 4GB is a limitation of the .zip file format, not of the tools that create and modify zip files.
I wrote one that I never released publicly because it still hasn't been fully tested or documented. Since it's unlikely that I'll get around to doing that in the near future, I'll just link to it here. If you don't mind using something that's pre-alpha:

https://www.dropbox.com/s/jn1s64l6ihcie2v/ACDC.zip

You'll need zlib installed. Uses C++11. Only tried to compile it with VS2012.. it may take some tweaks to get it to compile with gcc/clang.

It focuses on binary files... so there are no 'getline' or any linebreak conversion functions.

It supports reading/writing, iterating the file list, adding/removing/renaming/etc, Zip64 (4+ GB files) is also supported but only sparsely tested.

You can look in the tests directory for some examples.

Simple usage example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <libacdc.h>
#include <cstdint>  // for uint8_t

int main()
{
    //===================================================
    // Opening a file "normally" from the OS's filesystem
    {
        auto file = ac::fs.openFile("myfile.bin");

        uint8_t  buffer[10];
        file->read(buffer, 10);                 // read 10 bytes
    }

    //===================================================
    // Opening a file from an archive
    auto zip = ac::fs.openFileSystem("myzip.zip");   // open the zip as a FileSystem

    auto file = zip->openFile( "path/someotherfile.bin" );

    uint8_t buffer[10];
    file->read(buffer, 10);
}


And of course I'm happy to answer any Qs.
Last edited on
> I need one that supports 4GB+ archives.

zlib (not to be confused with Linux zlibc) version 1.26 or later.
http://www.zlib.net/
closed account (N36fSL3A)
What's the library's license Disch?
I didn't pick one and don't really care. PD I guess.
I use PhysFS ( https://icculus.org/physfs/ ) when using archives.
Disch wrote:
I didn't pick one and don't really care. PD I guess.

Ack! Don't say that!

Use Boost License or something.
http://www.boost.org/users/license.html
Ack! Don't say that!


Why not?
http://www.wtfpl.net/faq/
Isn’t this license basically public domain?

Unfortunately, the definition of public domain varies with the jurisdictions, and it is in some places debatable whether someone who has not been dead for the last seventy years is entitled to put their own work in the public domain.
Last edited on
See, this whole legal mess is why Disch and I have given up on deciding a license.
Last edited on
Even with PD you run into issues. Wasn't there a game that had the code released to PD, but people started using the art and music to only be sued because they weren't included part of the PD? You have to be very careful even with PD.
closed account (N36fSL3A)
Because they can't read licenses. It's like people who think quake 3 is free when it's explicitly stated that the assets aren't.
...which is why you should use a simple, common, legally unambiguous license that gives people all the rights they want except stealing your work.

Like Boost's.

If you'd read the link you'd get more good reasons. The best of which is -- people will actually use your code. (License-less code scares legal departments!)
License-less code is implicitly copyrighted, right?

Is the license from unlicense.org not "legally unambiguous"? I don't care about people stealing my work, I know I created it.
@LB
I don't think it is ever about caring that it is stolen, it is more about them taking it, tweaking it slightly, the putting it out as theirs for profit. If you aren't properly covered by a proper license, you could be stuck watching them make a profit off your idea and you get nothing for them using your code.
Are you implying that permissive licenses aren't "proper"?
If you aren't properly covered by a proper license, you could be stuck watching them make a profit off your idea and you get nothing for them using your code.


I literally don't care.

Anyone can do whatever they want with the code I posted and I'm fine with it.
Pages: 12