Forcibly disable some currently unsupported zip operations
Jeffrey Pfau jeffrey@endrift.com
Fri, 18 Jul 2014 00:52:07 -0700
1 files changed,
13 insertions(+),
2 deletions(-)
jump to
M
src/util/vfs-zip.c
→
src/util/vfs-zip.c
@@ -247,9 +247,20 @@ }
struct VFile* _vdzOpenFile(struct VDir* vd, const char* path, int mode) { UNUSED(mode); - // TODO: support truncating, appending and creating + // TODO: support truncating, appending and creating, and write + struct VDirZip* vdz = (struct VDirZip*) vd; + + if ((mode & O_RDWR) == O_RDWR) { + // libzip doesn't allow for random access, so read/write is impossible without + // reading the entire file first. This approach will be supported eventually. + return 0; + } + + if (mode & O_WRONLY) { + // Write support is not yet implemented. + return 0; + } - struct VDirZip* vdz = (struct VDirZip*) vd; struct zip_stat s; if (zip_stat(vdz->z, path, 0, &s) < 0) { return 0;