SDL_OpenFileStorage(3)

πŸ’Ύ SDL_OpenFileStorage πŸ’Ύ

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, we're doing storage today πŸŽ€

✨ NAME ✨

SDL_OpenFileStorage β€” opens up a container for local filesystem storage. that's it, that's the job πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_storage.h>

SDL_Storage * SDL_OpenFileStorage(const char *path);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like. this one is provided for development and tools. that's its whole lane, no cap. it is NOT the one you want for your actual shipping game, bestie, i'm gonna hold your hand when i say this:

if you're making a portable application, you should be using SDL_OpenTitleStorage() for access to game data and SDL_OpenUserStorage() for access to user data. those are your mains. SDL_OpenFileStorage() is the dev/tools girlie, and we love her for that πŸ’–


πŸ’œ FUNCTION PARAMETERS πŸ’œ

  • path β€” the base path prepended to all storage paths, or NULL for no base path. so basically whatever you drop in here becomes the prefix on top of everything else you ask for ✨

πŸ‘‘ RETURN VALUE πŸ‘‘

Returns a filesystem storage container on success or NULL on failure 😭 and if you get the NULL? call SDL_GetError() for more information, she will tell you what went wrong fr fr.


🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0 ⭐


πŸ’€ SEE ALSO πŸ’€


lowkey the whole storage family ate, go read all of them, iykyk 🫢

and that's the page!! brought to you by Simple Directmedia Layer, running the SDL 3.4.18 era, and if you need me i'll be right here in SDL_OpenFileStorage(3) being iconic πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from