C - Find the location of the executable ======================================= Public domain ******************************************************************************** #include #include #define BUFSIZE 1024 int main() { char buffer[BUFSIZE]; readlink("/proc/self/exe", buffer, BUFSIZE); printf("I am in %s\n", dirname(buffer)); return 0; } ******************************************************************************** _BY: Pejman Moghadam_ _TAG: proc, readlink, dirname_ _DATE: 2012-02-23 23:49:26_