The only write API is the one-shot SDL_PhysFS_WriteFile. There is no way to get a writable SDL_IOStream* that callers can pass to SDL_SaveBMP_IO, Mix_SaveWAV_IO, or other SDL functions that consume a stream. The internal SDL_PhysFS_OpenIO already supports writes — it just needs a public constructor that opens a PHYSFS_File for writing.
Suggested Implementation
SDL_IOStream* SDL_PhysFS_IOFromFileWrite(const char* filename);
// opens PHYSFS_openWrite(filename), wraps with SDL_PhysFS_OpenIO
An append-mode variant (SDL_PhysFS_IOFromFileAppend) could follow the same pattern using PHYSFS_openAppend.
QA
Test: open a write stream, write bytes via SDL_WriteIO, close, verify with SDL_PhysFS_LoadFile.
The only write API is the one-shot
SDL_PhysFS_WriteFile. There is no way to get a writableSDL_IOStream*that callers can pass toSDL_SaveBMP_IO,Mix_SaveWAV_IO, or other SDL functions that consume a stream. The internalSDL_PhysFS_OpenIOalready supports writes — it just needs a public constructor that opens aPHYSFS_Filefor writing.Suggested Implementation
An append-mode variant (
SDL_PhysFS_IOFromFileAppend) could follow the same pattern usingPHYSFS_openAppend.QA
Test: open a write stream, write bytes via
SDL_WriteIO, close, verify withSDL_PhysFS_LoadFile.