Skip to content

Fix a bug in the open() function in the Storage Access Framework VFS backend#18360

Merged
LibretroAdmin merged 1 commit intolibretro:masterfrom
white-axe:storage-access-framework
Nov 5, 2025
Merged

Fix a bug in the open() function in the Storage Access Framework VFS backend#18360
LibretroAdmin merged 1 commit intolibretro:masterfrom
white-axe:storage-access-framework

Conversation

@white-axe
Copy link
Copy Markdown
Contributor

@white-axe white-axe commented Nov 5, 2025

Description

Support for the Storage Access Framework was added to the libretro-common VFS code in #18336, but the function for opening files in that VFS backend has a bug where if the file you're trying to open doesn't already exist, it is created if and only if (mode & RETRO_VFS_FILE_ACCESS_WRITE) != 0 (otherwise the file is not created and the function returns null).

The actual correct behaviour that would be consistent with the other existing VFS backends is if the file doesn't exist, the file should be created if and only if (mode & RETRO_VFS_FILE_ACCESS_WRITE) != 0 && (mode & RETRO_VFS_FILE_ACCESS_UPDATE_EXISTING) == 0 is true, which I've corrected the function to do in this pull request.

@LibretroAdmin LibretroAdmin merged commit ee59a4e into libretro:master Nov 5, 2025
31 checks passed
@white-axe white-axe deleted the storage-access-framework branch November 5, 2025 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants