List Archive
Thread
-
Failed to unzip file by zip_fdopen with the error ,
Qifei Wang
(2019/09/07 01:03:25)
- Re: Failed to unzip file by zip_fdopen with the er, Qifei Wang (2019/09/07 02:01:02)
-
Re: Failed to unzip file by zip_fdopen with the er,
Thomas Klausner
(2019/09/07 20:52:49)
-
Re: Failed to unzip file by zip_fdopen with the er,
Qifei Wang
(2019/09/08 01:09:37)
- Re: Failed to unzip file by zip_fdopen with the er, Thomas Klausner (2019/09/08 07:10:36)
-
Re: Failed to unzip file by zip_fdopen with the er,
Qifei Wang
(2019/09/08 01:09:37)
Message
On Fri, Sep 06, 2019 at 06:03:06PM -0700, Qifei Wang wrote: > I am trying to unzip a zip file from file descriptor by the following > code snippet. It reports the error ZIP_ER_OPNOTSUPP. The file descriptor is > valid. The error seems reported by zip_open_from_source() method. See > https://github.com/nih-at/libzip/blob/master/lib/zip_open.c#L106. Any idea > about this? I see one location that actually does set that error: if ((st.valid & ZIP_STAT_SIZE) == 0) { zip_error_set(error, ZIP_ER_SEEK, EOPNOTSUPP); return NULL; } For reading an archive, libzip starts at the end and parses the EOCD(64) marker and then the central directory. Perhaps the stat() to find out the filesize failed? You could read the file from the server into a memory buffer and open the zip archive from there. Thomas
Made by MHonArc.