---
name: "SDL_GetCurrentDirectory"
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_GetCurrentDirectory"
---

# SDL\_GetCurrentDirectory(3)

Get what the system believes is the "current working directory."

## NAME

SDL\_GetCurrentDirectory - Get what the system believes is the "current working directory."

## HEADER FILE

Defined in SDL3/SDL\_filesystem.h

## SYNOPSIS

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

**char \* SDL\_GetCurrentDirectory(void);**

## DESCRIPTION

For systems without a concept of a current working directory, this will still attempt to provide something reasonable.

SDL does not provide a means to \_change\_ the current working directory; for platforms without this concept, this would cause surprises with file access outside of SDL.

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

## RETURN VALUE

Returns a UTF-8 string of the current working directory in platform-dependent notation. NULL if there's a problem. This should be freed with  **SDL\_free** () when it is no longer needed.

## AVAILABILITY

This function is available since SDL 3.2.0.
