I found a problem while using the ported libzip 0.9.3 when creating a .zip file from within a ps3 homebrew app:
When you try to create an archive.zip, libzip ends up creating archive.zip.XXXXX (where XXXXX is a random extension)
I tracked down the issue back to the libzip source code, and fixed it. The libzip code creates a temp file and when it finishes, it tries to rename it to the desired filename, e.g. archive.zip.
The fix I made was to re-define the _zip_rename() to sysLv2FsRename() in ./libzip-0.9.3/lib/zipint.h:
#ifdef HAVE_MOVEFILEEXA
#include <windows.h>
#define _zip_rename(s, t) \
(!MoveFileExA((s), (t), \
MOVEFILE_COPY_ALLOWED|MOVEFILE_REPLACE_EXISTING))
#else
#include <sys/file.h>
#define _zip_rename sysLv2FsRename
#endif
I don't know how to properly share this patch, so I'm attaching the whole zipint.h file to this issue: zipint.h.zip
I found a problem while using the ported libzip 0.9.3 when creating a
.zipfile from within a ps3 homebrew app:When you try to create an
archive.zip, libzip ends up creatingarchive.zip.XXXXX(where XXXXX is a random extension)I tracked down the issue back to the libzip source code, and fixed it. The libzip code creates a temp file and when it finishes, it tries to rename it to the desired filename, e.g.
archive.zip.The fix I made was to re-define the
_zip_rename()tosysLv2FsRename()in./libzip-0.9.3/lib/zipint.h:I don't know how to properly share this patch, so I'm attaching the whole
zipint.hfile to this issue: zipint.h.zip