Date: Wed, 16 Apr 1997 10:54:31 +0300 (IDT) From: Eli Zaretskii To: Benjamin D Chambers cc: djgpp AT delorie DOT com Subject: Re: .exe name? In-Reply-To: <19970415.163210.4935.0.chambersb@juno.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 15 Apr 1997, Benjamin D Chambers wrote: > How does a function, independant of the rest of the program, determine > the name of the executable file running? By looking at argv[0], of course: extern int __crt0_argc; extern char **__crt0_argv; These are global variables defined in the startup code which hold the values of `argc' and `argv' passed to your `main' function. Note that this is *very* DJGPP-specific (I'm not sure it won't break even in DJGPP v1.x).