Artifact 468f6769a6729a46f007101911c71bdbd411ac6cc598fa8d6794a26751683139:
- File doc/markdown/FindExec.md — part of check-in [5e80e55e41] at 2026-09-26 22:40:07 on branch tip-700 — - added a "title" metadata element to the generated yaml block to satisfy Pandoc when converting to HTML - added markdown2html.tcl as prototype/placeholder of conversion script markdown -> HTML - added some CSS to play with a good visual representation of the generated HTML, starting with the n section pages - fixed man2markdown.tcl not giving the two .TP/.IP parsing places the same treatment (user: Torsten, size: 2666) [annotate] [blame] [check-ins using]
- File doc/markdown/TclCAPI/FindExec.md — part of check-in [b84ce0eee1] at 2026-10-04 22:10:02 on branch tip-700 — file location re-organisation (part 1) (user: Torsten, size: 2666) [annotate] [blame] [check-ins using]
CommandName: Tcl_FindExecutable title: Tcl_FindExecutable ManualSection: 3 Version: 9.1 TclPart: Tcl TclDescription: Tcl Library Procedures Keywords:
- binary
- executable file Copyright:
- Copyright (c) 1995-1996 Sun Microsystems, Inc. ---
Name
Tcl_FindExecutable, Tcl_GetNameOfExecutable - identify or return the name of the binary file containing the application
Synopsis
::: {.synopsis} ::: #include <tcl.h> [const char *]{.ret} [Tcl_FindExecutable]{.ccmd} [argv0]{.cargs} [const char *]{.ret} [Tcl_GetNameOfExecutable]{.ccmd} []{.cargs} :::
Arguments
::: {.arguments} :::
[*argv0]{.carg .in type="char"} : The first command-line argument to the program, which gives the application's name.
:::
Description
Tcl_FindExecutable is one of two functions, TclZipfs_AppHook being the other, that must be called by an application to initialize Tcl prior to any other calls into Tcl. Applications that wish to use ZipFS-based builds should call TclZipfs_AppHook in preference to this function.
On UNIX platforms, the function should be passed argv[0] as its argument. It is important not to change the working directory before this invocation. Tcl_FindExecutable uses argv0 together with the PATH environment variable to locate the application's executable, if possible. If it fails to find the binary, subsequent calls to info nameofexecutable will return an empty string.
On Windows platforms, the argv[0] argument is used only to indicate whether the executable has a standard error channel (any non-null value) or not (the value null). If Tcl_SetPanicProc is never called and no debugger is running, this setting determines whether a panic message is sent to standard error or displayed in a system dialog.
As part of its initialization sequence, Tcl_FindExecutable computes the full path name of the executable file from which the application was invoked. This result is saved for Tcl's internal use and is returned by the info nameofexecutable command.
The result of Tcl_FindExecutable is the full Tcl version string, including build information (for example, 9.0.0+abcdef...abcdef.gcc-1002).
Tcl_GetNameOfExecutable simply returns a pointer to the internal full path name of the executable file as computed by Tcl_FindExecutable. This procedure call is the C API equivalent to the info nameofexecutable command. NULL is returned if the internal full path name has not been computed or unknown.
Tcl_FindExecutable can not be used in stub-enabled extensions.