get_executable_name(3alleg)

get_executable_name3alleg

Obtains the full path to the current executable. allegro game programming library.

Usage

#include <allegro.h>

void get_executable_name(char *buf, int size);

Overview

Fills `buf' with the full path to the current executable, writing at most `size' bytes. This 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. Example:

   char name[200];
   ...
   get_executable_name(name, sizeof(name));
   allegro_message("Running `%s'\n", name);

Releases

4 releases since Debian 3.1 (Sarge); the text changed 2 times.

  1. 3.1
  2. 4.0
  3. 5.0–6.0

From liballegro-doc 2:4.2.2-2.2 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.