Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/doc/FindExec.3 @ 25

Last change on this file since 25 was 25, checked in by landauf, 16 years ago

added tcl to libs

File size: 2.0 KB
Line 
1'\"
2'\" Copyright (c) 1995-1996 Sun Microsystems, Inc.
3'\"
4'\" See the file "license.terms" for information on usage and redistribution
5'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
6'\"
7'\" RCS: @(#) $Id: FindExec.3,v 1.7 2004/10/07 15:15:38 dkf Exp $
8'\"
9.so man.macros
10.TH Tcl_FindExecutable 3 8.1 Tcl "Tcl Library Procedures"
11.BS
12.SH NAME
13Tcl_FindExecutable, Tcl_GetNameOfExecutable \- identify or return the name of the binary file containing the application
14.SH SYNOPSIS
15.nf
16\fB#include <tcl.h>\fR
17.sp
18void
19\fBTcl_FindExecutable\fR(\fIargv0\fR)
20.sp
21const char *
22\fBTcl_GetNameOfExecutable\fR()
23.SH ARGUMENTS
24.AS char *argv0
25.AP char *argv0 in
26The first command-line argument to the program, which gives the
27application's name.
28.BE
29
30.SH DESCRIPTION
31.PP
32The \fBTcl_FindExecutable\fR procedure computes the full path name of
33the executable file from which the application was invoked and saves
34it for Tcl's internal use.
35The executable's path name is needed for several purposes in
36Tcl.  For example, it is needed on some platforms in the
37implementation of the \fBload\fR command.
38It is also returned by the \fBinfo nameofexecutable\fR command.
39.PP
40On UNIX platforms this procedure is typically invoked as the very
41first 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
43working directory before the invocation.
44\fBTcl_FindExecutable\fR uses \fIargv0\fR
45along with the \fBPATH\fR environment variable to find the
46application's executable, if possible.  If it fails to find
47the binary, then future calls to \fBinfo nameofexecutable\fR
48will return an empty string.
49.PP
50\fBTcl_GetNameOfExecutable\fR simply returns a pointer to the
51internal full path name of the executable file as computed by
52\fBTcl_FindExecutable\fR.  This procedure call is the C API
53equivalent to the \fBinfo nameofexecutable\fR command.  NULL
54is returned if the internal full path name has not been
55computed or unknown.
56
57.SH KEYWORDS
58binary, executable file
Note: See TracBrowser for help on using the repository browser.