get_executable_name(3)
β¨ NAME β¨
okay so bestie, welcome to the get_executable_name(3) page from the Allegro manual πΈ this one is all about getting the full path to the current executable, and it's part of the Allegro game programming library π
get_executable_nameβ obtains the full path to the current executable. Allegro game programming library. π
π¦ SYNOPSIS π¦
#include <allegro.h>
void get_executable_name(char *buf, int size);
π DESCRIPTION π
okay so what does it actually do? It fills buf with the full path to the current executable, writing at most size bytes. periodt. β¨
The way it finds that path is lowkey a whole journey: it generally comes from argv[0], but on Unix systems it tries to get the information from the /proc filesystem first, searching the directories specified in $PATH if necessary. If this fails too, it tries to find the executable name from the output of the ps command, using argv[0] only as a last resort if all other options fail. π fr fr, detective mode.
Example:
char name[200];
...
get_executable_name(name, sizeof(name));
allegro_message("Running `%s'\n", name);
Allegro manual, version 4.4.3 β and the date slot is empty on this page, bestie, so no date to spill ππ that's the whole tea, periodt.
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms