[physfs] Physfs not seeing a file in zip archive

Ivan Safrin ivansafrin at gmail.com
Sat May 11 20:03:25 EDT 2013


You can find the file here:

https://dl.dropboxusercontent.com/u/4011871/test2.zip

And here's the testing code for it (it sees the first file, but not the
second while both are in the archive):

#include <stdio.h>
#include <physfs.h>

int main(int argc, char **argv) {

PHYSFS_init(NULL);
PHYSFS_addToSearchPath("test2.zip", 1);

if(PHYSFS_exists("src/engine/components/Health.lua")) {
printf("YES\n");
} else {
printf("NO\n");
}

if(PHYSFS_exists("src/engine/entities/PlayerChar.lua")) {
printf("YES\n");
} else {
printf("NO\n");
}
}



On Sat, May 11, 2013 at 7:55 PM, Sik the hedgehog <
sik.the.hedgehog at gmail.com> wrote:

> If everything else can see it and only PhysicsFS can't, I'd say it's
> most likely a PhysicsFS bug and you're probably hitting a corner case.
> Can you provide a ZIP file that shows this issue?
>
> 2013/5/11, Ivan Safrin <ivansafrin at gmail.com>:
> > Hello!
> >
> > I am the lead developer of Polycode, which uses PhysFS fairly heavily
> (thank
> > you so much for your work on PhysFS, it's an amazing project!).
> >
> > We've encountered a strange issue of a file not being found by PhysFS
> within
> > a zip archive. It occurs only when it's created with polycode's build
> tool,
> > which uses the minizip library for creating the zip archive (when I use
> my
> > Mac's Compress function to create the zip, the file can be seen by PhysFS
> > correctly).
> >
> > The strange thing is it happens very inconsistently, with the order or
> even
> > amounts of other files in the archive impacting whether this file can be
> > seen or not (with all other files reading properly). I can unzip the file
> > correctly using most unzip tools and it seems that PhysFS is the only one
> > that has a problem seeing the file.
> >
> > I stepped through PHYSFS_exists and it seems that it indeed fails in
> > zip_find_entry not finding the entry for said file.
> >
> > Since PhysFS has no problem seeing the file in a zip file created by an
> > "official" zip tool, I am assuming that the issue is most likely with my
> not
> > setting proper flags while adding files to the archive, not with PhysFS
> > itself, but since other tools don't seem to have a problem unzipping the
> > file, I'm wondering if anyone has encountered a similar problem before.
> >
> > Thank you!
> >
> > - Ivan
> >
> >
> >
> _______________________________________________
> physfs mailing list
> physfs at icculus.org
> http://icculus.org/mailman/listinfo/physfs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/physfs/attachments/20130511/f94a55a3/attachment.html>


More information about the physfs mailing list