SDL_GetPathInfo(3)

πŸ’– SDL_GetPathInfo(3) πŸ’–

okay so bestie, welcome to the SDL3 FUNCTIONS corner of the manual, this one's called SDL_GetPathInfo and it's literally the "what even is this path" detector πŸ•΅οΈβ™€οΈβœ¨


🌸 NAME 🌸

SDL_GetPathInfo β€” get information about a filesystem path. that's it, that's the whole job, and she does it flawlessly πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_filesystem.h>

bool SDL_GetPathInfo(const char *path, SDL_PathInfo *info);

look at her. two args. returns a bool. iconic. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea πŸ«– β€” symlinks are ALWAYS followed on filesystems that support them. so you're never getting the info about the symlink itself, no ma'am, you get the info on whatever that symlink eventually points to. like, you asked about the girl and you got her whole friend group instead. no cap. πŸŽ€


🧚 FUNCTION PARAMETERS 🧚

  • path β€” the path you wanna query. the one you're curious about. the main character of this operation. 🌟
  • info β€” a pointer that gets filled in with the info about the path. OR you can pass NULL β€” in which case it's just checking whether the file exists at all. lowkey a whole vibe check for your file. πŸ’€

🌈 RETURN VALUE 🌈

returns true on success, or false if the file doesn't exist, or if some other failure happened (rude). when that happens, hit up SDL_GetError() for the deets, she'll tell you what went wrong. 😭


πŸ’œ THREAD SAFETY πŸ’œ

it is safe to call this function from any thread. go wild, gorl. multi-threaded queen behavior fr fr. 🧡✨


⭐ AVAILABILITY ⭐

this function has been available since SDL 3.2.0. so if you're on anything older... bestie. upgrade. πŸ™ˆ


and that's the whole page, periodt πŸ’– this was written by the lovely folks at Simple Directmedia Layer, and it's page SDL_GetPathInfo(3) from SDL 3.4.18. mwah, go query some paths, you got this πŸŽ€πŸ«ΆπŸŒΈ

πŸ“¦ where this page comes from