SDL Wiki
(This is the documentation for SDL3, which is under heavy development and the API is changing! SDL2 is the current stable version!)


Finds the most suitable user folder for a specific purpose.

Header File

Defined in <SDL3/SDL_filesystem.h>


const char * SDL_GetUserFolder(SDL_Folder folder);

Function Parameters

SDL_Folder folder the type of folder to find.

Return Value

(const char *) Returns either a null-terminated C string containing the full path to the folder, or NULL if an error happened.


Many OSes provide certain standard folders for certain purposes, such as storing pictures, music or videos for a certain user. This function gives the path for many of those special locations.

This function is specifically for user folders, which are meant for the user to access and manage. For application-specific folders, meant to hold data for the application to manage, see SDL_GetBasePath() and SDL_GetPrefPath().

The returned path is guaranteed to end with a path separator ('\' on Windows, '/' on most other platforms).

This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory().

If NULL is returned, the error may be obtained with SDL_GetError().


This function is available since SDL 3.0.0.

CategoryAPI, CategoryAPIFunction, CategoryFilesystem

[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.