SDL_RemovePath(3)

πŸ’– SDL_RemovePath πŸ’–

okay bestie so real quick β€” this is a page from the SDL3 FUNCTIONS manual, and today's main character is SDL_RemovePath. she's simple, she's iconic, she deletes one (1) thing. let's get into it πŸŽ€


✨ NAME ✨

SDL_RemovePath β€” Remove a file or an empty directory. that's it. that's the whole job. no cap. πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_filesystem.h>

bool SDL_RemovePath(const char *path);

yes girl, one include, one function call, one bool. lowkey the cleanest API you'll ever meet 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, and it's important tea: directories that are not empty will fail. this function will not recursely delete directory trees. she is NOT out here bulldozing a whole folder of your stuff β€” she's removing one file, or one directory that's already empty. if there's anything still inside, she's gonna say no. πŸ™ˆ

think of it like: she'll take the box out to the curb, but she will not go through the box for you. πŸ“¦


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • path β€” the path to remove from the filesystem. literally just point at the thing and she'll yeet it (as long as it's a file or an empty directory, per above πŸ’–).

⭐ RETURN VALUE ⭐

Returns true on success or false on failure β€” and if it's a false girlie, call SDL_GetError() for more information. she's not gonna leave you guessing, she'll tell you what went wrong 🌈


πŸ’œ THREAD SAFETY πŸ’œ

It is safe to call this function from any thread. go off, multithreaded queen πŸ‘‘


🌟 AVAILABILITY 🌟

This function is available since SDL 3.2.0. so if you're on anything older, that's a no from her πŸ’€


and that's the whole page, bestie β€” short, sweet, and fully aware of her limits. v important energy ngl.

made with love by the Simple Directmedia Layer girlies, version SDL 3.4.18, page SDL_RemovePath(3). mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from