[physfs] physfs 2.1: PHYSFS_enumerateFiles (symlink related?)

Martin Felis martin at fysx.org
Sun Feb 9 16:56:08 EST 2014


@Jonas: which OS are you using? Also which physfs version? Very
strange that omitting the trailing slash does not fix it for you.

At least for the slash fix: It seems that cnumCallbackFilterSymLinks
(near line 2241) does not properly trim the directory string. It only
removes the starting slash, but not the trailing one. This results in
a double slash in the path that is queried a few lines further down to

    if (dh->funcs->stat(dh->opaque, path, &statbuf)) { ... }.

As this double slash path does not exist the result the body of the if
statement does not get executed and no paths added to the directory

Is there a policy on whether trailing slashes are allowed or not?


On 08.02.2014 15:18, Jonas Thiem wrote:
> Hi Martin,
> I just tried this and PHYSFS_permitSymbolicLinks(1) resolves the
> issue for me as well. However, I don't have a trailing slash even,
> it just doesn't work at all for me (no matter if trailing slash or
> not) unless I permit symbolic links as you suggested.
> I don't have any symbolic links I'm aware of though, it's just a 
> regular zip file.
> Thanks a lot for finding a work around!
> Regards, Jonas Thiem
> On 02/08/2014 11:48 AM, Martin Felis wrote:
>> Hi there,
>> (this might be related to the mail of Jonas Thiem 
>> http://icculus.org/pipermail/physfs/2014-January/001130.html. 
>> Unfortunately I could not reply to his thread as I joined the 
>> mailinglist just recently)
>> I am using latest mercurial version of physfs 2.1 and have a 
>> problem with PHYSFS_enumerateFiles(). I do get empty results
>> when querying the contents of a zip archive.
>> For an archive with the layout:
>> file1.txt file2.txt somesubdir/subfile1.txt 
>> somesubdir/subfile2.txt
>> the call to
>> PHYSFS_enumerateFiles ("/somesubdir/");
>> returns an empty list.
>> When either setting PHYSFS_permitSymbolicLinks(1) or omitting the
>>  trailing '/' yields the expected results.
>> Is this intended?
>> Cheers, Martin _______________________________________________ 
>> physfs mailing list physfs at icculus.org 
>> http://icculus.org/mailman/listinfo/physfs
> _______________________________________________ physfs mailing
> list physfs at icculus.org http://icculus.org/mailman/listinfo/physfs

More information about the physfs mailing list