Open barbudreadmon opened 4 years ago
@barbudreadmon , just fixed this issue in mame2003-plus.
The problem is if you send path_mkdir() a path to create containing a trailing slash, this path gets copied to basedir and then the slash is removed from basedir if it's defined as a gekko based system. It then checks if basedir is a valid path or not to create. If it's valid, it enables the non recursive function that actually makes the new directory by using the original path, dir, which still contains the trailing slash. So it fails on wiiu because it can't make path dir containing the trailing slash.
They corrected the path it checks (basedir), but then it tries to make the bad path(dir). You need to also remove the trailing slash from dir then make sure your core isn't sending any file paths to path_mkdir with trailing slashes.
We also force create our system and save directories anytime osd_get_path() in src/fileio.c is called if they are not already created by default.
make sure your core isn't sending any file paths to path_mkdir with trailing slashes.
Yes, that's exactly what i did when fixing this issue in FBNeo a few months ago
Yes, that's exactly what i did when fixing this issue in FBNeo a few months ago
Ok cool. Didn't know where you guys were with this issue. Just figured I'd share what we did in case it was still an open issue.
This ideally needs to be corrected in path_mkdir() by removing any trailing slashes in dir
as well under the if defined gekko section.
@barbudreadmon I just fixed path_mkdir() for gekko systems in #172. If it gets merged. Not sure if this will effect your fix in fbneo or not.
ok, thanks for the heads-up
@barbudreadmon #172 should fix these create issues if you want to test it with your core and wiiu.
hmmm, how come you are freeing len
& len2
? They aren't ptr (http://www.cplusplus.com/reference/cstdlib/free/).
@barbudreadmon whoops. I meant to free newdir, fixed it now. Please test the updated fix. I don't have a wiiu but I believe this should fix it from the libretro side. If so you'll have to check your slash situation in fbneo
I've no real means for testing this either :/. No wiiu sdk and no emulator able to run RA wiiu homebrew available on linux anyway.
While there is this workaround : https://github.com/libretro/libretro-common/blob/44c1cd8bd84b26934d00ce2841e9ed5987029e97/file/file_path_io.c#L199-L211
It still doesn't seem
path_mkdir
works properly on wii u when there is a trailing slash (the workaround makes sense so i'm not sure what's the issue and i don't have the means to debug this myself, all i can do is to try fixing this by removing the trailing slash in https://github.com/libretro/FBNeo/commit/5b472aa42ace69c5250b3d8a9ff518f78fa1a64a then https://github.com/libretro/FBNeo/commit/eeaabd16bdc2df08e05fa8d0df29f911c8e7f92e)