It exits loop at first iteration because statbuf.filetype is PHYSFS_FILETYPE_SYMLINK for /var.
Not sure what the correct fix would be. Maybe to call stat with path ending with / like /var/ in this case statbuf.filetype is set correctly toPHYSFS_FILETYPE_DIRECTORY and rest works.
Also, (statbuf.filetype == PHYSFS_FILETYPE_DIRECTORY || statbuf.filetype == PHYSFS_FILETYPE_SYMLINK) can work around the problem in this case and the folder gets created at the end.
PHYSFS_mkdir is called to create path in Application Support folder
Path passed is like
"/var/mobile/Containers/Data/Application/A493CCAC-6FEE-434B-A5D4-1131850578C1/Library/Application Support/savegame"
.I traced the problem to the
doMkdir
https://github.com/icculus/physfs/blob/main/src/physfs.c#L2237It exits loop at first iteration because
statbuf.filetype
isPHYSFS_FILETYPE_SYMLINK
for/var
.Not sure what the correct fix would be. Maybe to call stat with path ending with
/
like/var/
in this casestatbuf.filetype
is set correctly toPHYSFS_FILETYPE_DIRECTORY
and rest works.Also,
(statbuf.filetype == PHYSFS_FILETYPE_DIRECTORY || statbuf.filetype == PHYSFS_FILETYPE_SYMLINK)
can work around the problem in this case and the folder gets created at the end.