Tcl Library Procedures Tcl_FindExecutable(3TCL)
_________________________________________________________________
NAME
Tcl_FindExecutable, Tcl_GetNameOfExecutable - identify or
return the name of the binary file containing the applica-
tionSYNOPSIS
#include
voidTcl_FindExecutable(argv0)
CONST char *Tcl_GetNameOfExecutable()
ARGUMENTSchar *argv0 (in) The first command-line argument to
the program, which gives the application's name._________________________________________________________________
DESCRIPTION
The Tcl_FindExecutable procedure computes the full path name
of the executable file from which the application was invoked and saves it for Tcl's internal use. The executable's path name is needed for several purposes in Tcl. For example, it is needed on some platforms in the implementation of the load command. It is also returned by the info nameofexecutable command. On UNIX platforms this procedure is typically invoked as the very first thing in the application's main program; it must be passed argv[0] as its argument. It is important not to change the working directory before the invocation.Tcl_FindExecutable uses argv0 along with the PATH environ-
ment variable to find the application's executable, if pos-
sible. If it fails to find the binary, then future calls to info nameofexecutable will return an empty string.Tcl_GetNameOfExecutable simply returns a pointer to the
internal full path name of the executable file as computedby Tcl_FindExecutable. This procedure call is the C API
equivalent to the info nameofexecutable command. NULL isreturned if the internal full path name has not been com-
puted or unknown. KEYWORDS binary, executable file Tcl Last change: 8.1 1Tcl Library Procedures Tcl_FindExecutable(3TCL)
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:_______________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE|
|____________________|__________________|_
| Availability | runtime/tcl-8 |
|____________________|__________________|_
| Interface Stability| Uncommitted ||____________________|_________________|
NOTES Source for Tcl is available on http://opensolaris.org. Tcl Last change: 8.1 2