---
name: "SDL_GetUserFolder"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_GetUserFolder"
---

# SDL\_GetUserFolder(3)

Finds the most suitable user folder for a specific purpose.

## NAME

SDL\_GetUserFolder - Finds the most suitable user folder for a specific purpose.

## HEADER FILE

Defined in SDL3/SDL\_filesystem.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**const char \* SDL\_GetUserFolder(SDL\_Folder folder);**

## DESCRIPTION

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).

If NULL is returned, the error may be obtained with

**SDL\_GetError** ().

## FUNCTION PARAMETERS

- *folder*

  the type of folder to find.

## RETURN VALUE

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

## AVAILABILITY

This function is available since SDL 3.2.0.
