Skip to main content

SDL_GetCurrentDirectory

Function SDL_GetCurrentDirectory 

Source
pub unsafe extern "C" fn SDL_GetCurrentDirectory() -> *mut c_char
Expand description

Get what the system believes is the “current working directory.”

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

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.

Thread Safety: It is safe to call this function from any thread.

Available Since: This function is available since SDL 3.2.0.