Page 2 of 2

Re: Can't manage to filesystem.write nor filesystem.createDirectory

Posted: Sun Dec 11, 2022 7:16 pm
by svalorzen
Uuh, that's quite a good guess. I wouldn't call it weird partitioning, but I do have `.local` as a symlink to a folder in another partition (of an SSD, my home is on an HDD). I also really hope it's not this, I'm not sure I'd be able to fix it :P

Re: Can't manage to filesystem.write nor filesystem.createDirectory

Posted: Sun Dec 11, 2022 7:31 pm
by svalorzen
ARGHH, that's what it is! In `physfs.c`, the function that is supposed to create (recursively) the directory is called `doMkdir`. Inside, there is a loop that splits the incoming directory name by '/' (so that it can examine one piece at a time and generate the directories recursively).

If the directory already exists however, there is a special check to verify that each step of the way is indeed a directory:

Code: Select all

retval = ((rc) && (statbuf.filetype == PHYSFS_FILETYPE_DIRECTORY));
However, in my case, `.local` is not a directory but a symlink! So the entire thing fails! This seems to be a fairly dumb oversight though, no? Should I report this somewhere?

Another thing which is annoying is that this type of error is not really considered; so LOVE in the end only gets "not found" as an error, which would make it harder to also report the problem to the user -- not that it's trying to currently, but still.

Re: Can't manage to filesystem.write nor filesystem.createDirectory

Posted: Sun Dec 11, 2022 7:36 pm
by svalorzen
And it seems that the latest version of physfs has this fixed; going to the GitHub repo I checked and it seems that the relevant line has been changed:

Code: Select all

retval = ( (rc) && ((statbuf.filetype == PHYSFS_FILETYPE_DIRECTORY) || (statbuf.filetype == PHYSFS_FILETYPE_SYMLINK)) );
I wonder if I'm really so unlucky that I'm stumbling in all these problems xD Any idea on whether love will at some point integrate this? I guess for now I can just clean up the repo on my machine, fix the problem and use my compiled binary..

EDIT: to avoid adding one more post; I have verified that simply replacing the offending line with the one I wrote above fixes the problem.. now my save directory is correctly created and I can write to it :)

Re: Can't manage to filesystem.write nor filesystem.createDirectory

Posted: Sun Dec 11, 2022 7:43 pm
by Andlac028
You can try to look at love’s github repo into development branch, if it will be fixed in 12.0, and if not, you may try to suggest it in issues.

Re: Can't manage to filesystem.write nor filesystem.createDirectory

Posted: Sun Dec 11, 2022 8:00 pm
by svalorzen
Thanks, I just checked, it seems physfs' version there is the same as in 11.4. I have opened an issue about this, will keep this posted :)