Questions tagged [libzip]

libzip is a widely used open source library for creating, writing and processing zip files

82 questions
2
votes
1 answer

How do I save a binary file from libzip

My goal is to write file to disk If I use gio to create the file GError *error; char path[strlen(dirpath)]; sprintf(path, "%s", dirpath); // Create path to the file by copying from another variable zip_file_t *contentfile = zip_fopen_index(book,…
Bret Joseph
  • 185
  • 8
2
votes
3 answers

How to install zip extension for PHP 7.4 compiled from scratch on CentOS 7?

I have a PHP 7.4.2 installation, which is installed by compiling from the scratch. The configure command I used is as given below : './configure' '--with-apxs2=/usr/bin/apxs' '--with-curl=/usr' '--with-gd' '--with-gettext' '--with-jpeg-dir=/usr'…
Happy Coder
  • 4,255
  • 13
  • 75
  • 152
2
votes
1 answer

libzip with zip_source_buffer causes data corruption and/or segfaults

I am trying to use libzip with zip_source_buffer, to write data from local buffers to a zipfile. std::vector buf; struct zip * z = zip_open(zipfilename.c_str(),ZIP_CREATE | ZIP_EXCL,NULL); if (!z) { messagelabel->setText("failed to open…
plugwash
  • 9,724
  • 2
  • 38
  • 51
2
votes
1 answer

Does LIBZIP provides a way to check if zip_file is a DIRECTORY?

I'm using a pretty old version of libzip (0.10.1-1.2) due compatibility matters. Usually we do check file type (symbolic link, dir, file, etc) by its stat result. Analogously, on libzip we zip_stat, but its structure do not contain anything like…
Rodrigo Borba
  • 1,334
  • 1
  • 14
  • 21
2
votes
1 answer

Writing file inside zip using libzip

I am using libzip android port from here. I am able to add a new file in my archive calling zip_add(_zip, filePath, zip_source_callback). it creates an empty file. How can i write data to this empty file? I know i have to handle it in my…
Rahul Kumar
  • 340
  • 1
  • 3
  • 12
2
votes
2 answers

Using libzip library from Visual Studio 2017 and cmake

I have a c++ program that was originally written in Linux. The program uses functions from the library libzip: https://libzip.org I am now working on a windows-based platform in Visual Studio 2017. Everthing works, as I could basically use the same…
2
votes
1 answer

Understanding how libzip works

I have started working with the libzip library today. But I do not understand the principle how libzip works. My focus is on zipping a directory with all the files and dirs within into a zip-file. Therefore, I started with zip_open(), then I read…
tria1312
  • 153
  • 1
  • 1
  • 8
1
vote
1 answer

Add multiple files from buffers to ZIP archive using libzip

I'm trying to use libzip in a program that needs to archive several data chunks in different files. At the moment I have a code similar to the following snippet, edited from in-memory.c example in libzip examples. The zip file is correctly saved…
Giulio
  • 11
  • 1
1
vote
1 answer

How to create an archive of the folder using C++ in Visual Studio 2019, Windows

I wanted to create a Windows Service which copies content of the folder into a created archive. I was suggested to use libzip library for this purpouse. I've created this code, but now I do not know how to compile and link it properly. I am not…
Alvov1
  • 157
  • 1
  • 2
  • 10
1
vote
0 answers

How to install MAMP PHP zip extension on masOS Big Sur - M1 arch?

I'm trying to install php zip module on my new Macbook M1, by using: pecl install zip After a while i'm getting this error: configure: error: Please reinstall the libzip distribution ERROR: `/private/tmp/pear/temp/zip/configure…
1
vote
3 answers

libzip zip_source_t buffer is freed even tho I told libzip not to

I face an issue with libzip and I don't know if I did something wrong of if it's a bug in the library. First I create an archive with zip_source_buffer_create() from a zip file on disk (don't ask why I don't open the file directly). I set the freep…
PinkTurtle
  • 6,942
  • 3
  • 25
  • 44
1
vote
1 answer

How do I open a zip within a zip with libzip

I am trying to open a zip inside a zip #include "zip.h" #include "gtk.h" zip_t *mainzipfile = zip_open(g_file_get_path(file), ZIP_CHECKCONS, &error); zip_file_t *childzip = zip_fopen(mainzipfile, "child.zip", ZIP_RDONLY);// this…
Bret Joseph
  • 185
  • 8
1
vote
0 answers

building libzippp in macos with vcpkg: ld: library not found for -llibzip::libzip

libzippp github link vcpkg github link It is supposed to be straightforward, according to the documentation one should "just" ./vcpkg install libzippp But i've tried it plus a little bit of everything but nothing works. I'm using VS Code, my…
Alejandro Camba
  • 978
  • 10
  • 25
1
vote
0 answers

PHP 7.3 / Libzip Compile Errors (CWP)

I'm using Centos Web Panel. System details Currently my system: Apache/2.4.39, PHP 7.2.26, nginx-varnish-apache - I need help about PHP rebuilding or updating. PHP 7.1, 7.2, 7.3, with FPM, without FPM... it doesn't matter. Same errors. 2020-04-30…
fraz
  • 11
  • 2
1
vote
2 answers

Using SDL_image and SDL_RWops with LibZip to load pngs from a zip onto a surface, but won't recognize png

Relevant code: zip_stat_t filestat; uint64_t filetotal = 0; SDL_RWops* rwop = SDL_AllocRW(); //bunch of code that's not relevant to the matter goes here std::vector rwbuffer(filestat.size); rwop = SDL_RWFromMem(rwbuffer.data(),…
laura
  • 51
  • 5