2 '\" Copyright (c) 1995-1996 Sun Microsystems, Inc.
4 '\" See the file "license.terms" for information on usage and redistribution
5 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10 .TH Tcl_FindExecutable 3 8.1 Tcl "Tcl Library Procedures"
13 Tcl_FindExecutable, Tcl_GetNameOfExecutable \- identify or return the name of the binary file containing the application
16 \fB#include <tcl.h>\fR
19 \fBTcl_FindExecutable\fR(\fIargv0\fR)
22 \fBTcl_GetNameOfExecutable\fR()
26 The first command-line argument to the program, which gives the
32 The \fBTcl_FindExecutable\fR procedure computes the full path name of
33 the executable file from which the application was invoked and saves
34 it for Tcl's internal use.
35 The executable's path name is needed for several purposes in
36 Tcl. For example, it is needed on some platforms in the
37 implementation of the \fBload\fR command.
38 It is also returned by the \fBinfo nameofexecutable\fR command.
40 On UNIX platforms this procedure is typically invoked as the very
41 first thing in the application's main program; it must be passed
42 \fIargv[0]\fR as its argument. It is important not to change the
43 working directory before the invocation.
44 \fBTcl_FindExecutable\fR uses \fIargv0\fR
45 along with the \fBPATH\fR environment variable to find the
46 application's executable, if possible. If it fails to find
47 the binary, then future calls to \fBinfo nameofexecutable\fR
48 will return an empty string.
50 \fBTcl_GetNameOfExecutable\fR simply returns a pointer to the
51 internal full path name of the executable file as computed by
52 \fBTcl_FindExecutable\fR. This procedure call is the C API
53 equivalent to the \fBinfo nameofexecutable\fR command. NULL
54 is returned if the internal full path name has not been
58 binary, executable file