FindExec.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:2k
- '"
- '" Copyright (c) 1995-1996 Sun Microsystems, Inc.
- '"
- '" See the file "license.terms" for information on usage and redistribution
- '" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- '"
- '" RCS: @(#) $Id: FindExec.3,v 1.5 2001/09/28 17:07:54 msofer Exp $
- '"
- .so man.macros
- .TH Tcl_FindExecutable 3 8.1 Tcl "Tcl Library Procedures"
- .BS
- .SH NAME
- Tcl_FindExecutable, Tcl_GetNameOfExecutable - identify or return the name of the binary file containing the application
- .SH SYNOPSIS
- .nf
- fB#include <tcl.h>fR
- .sp
- void
- fBTcl_FindExecutablefR(fIargv0fR)
- .sp
- CONST char *
- fBTcl_GetNameOfExecutablefR()
- .SH ARGUMENTS
- .AS char *argv0 in
- .AP char *argv0 in
- The first command-line argument to the program, which gives the
- application's name.
- .BE
- .SH DESCRIPTION
- .PP
- The fBTcl_FindExecutablefR 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 fBloadfR command.
- It is also returned by the fBinfo nameofexecutablefR command.
- .PP
- On UNIX platforms this procedure is typically invoked as the very
- first thing in the application's main program; it must be passed
- fIargv[0]fR as its argument. It is important not to change the
- working directory before the invocation.
- fBTcl_FindExecutablefR uses fIargv0fR
- along with the fBPATHfR environment variable to find the
- application's executable, if possible. If it fails to find
- the binary, then future calls to fBinfo nameofexecutablefR
- will return an empty string.
- .PP
- fBTcl_GetNameOfExecutablefR simply returns a pointer to the
- internal full path name of the executable file as computed by
- fBTcl_FindExecutablefR. This procedure call is the C API
- equivalent to the fBinfo nameofexecutablefR command. NULL
- is returned if the internal full path name has not been
- computed or unknown.
- .SH KEYWORDS
- binary, executable file