SDL Wiki
(This is the documentation for SDL3, which is the current stable version. SDL2 was the previous version!)

SDL_GetCurrentDirectory

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

Header File

Defined in <SDL3/SDL_filesystem.h>

Syntax

char * SDL_GetCurrentDirectory(void);

Return Value

(char *) 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.

Remarks

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.

Version

This function is available since SDL 3.2.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.