Artifact 4061f0c478ce0a69daeba7096fa751480298ce6a655db8609929630631617f4a:
- File doc/markdown/GetCwd.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: 1764) [annotate] [blame] [check-ins using]
- File doc/markdown/TclCAPI/GetCwd.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: 1764) [annotate] [blame] [check-ins using]
CommandName: Tcl_GetCwd title: Tcl_GetCwd ManualSection: 3 Version: 8.1 TclPart: Tcl TclDescription: Tcl Library Procedures Keywords:
- pwd Copyright:
- Copyright (c) 1998-1999 Scriptics Corporation ---
Name
Tcl_GetCwd, Tcl_Chdir - manipulate the current working directory
Synopsis
::: {.synopsis} ::: #include <tcl.h> [char *]{.ret} [Tcl_GetCwd]{.ccmd} [interp, bufferPtr]{.cargs} [int]{.ret} [Tcl_Chdir]{.ccmd} [dirName]{.cargs} :::
Arguments
::: {.arguments} :::
[*interp]{.carg .in type="Tcl_Interp"} : Interpreter in which to report an error, if any.
[*bufferPtr]{.carg .in/out type="Tcl_DString"} : This dynamic string is used to store the current working directory. At the time of the call it should be uninitialized or free. The caller must eventually call Tcl_DStringFree to free up anything stored here.
[*dirName]{.carg .in type="const char"} : File path in UTF-8 format.
:::
Description
These procedures may be used to manipulate the current working directory for the application. They provide C-level access to the same functionality as the Tcl pwd command.
Tcl_GetCwd returns a pointer to a string specifying the current directory, or NULL if the current directory could not be determined. If NULL is returned, an error message is left in the interp's result. Storage for the result string is allocated in bufferPtr; the caller must call Tcl_DStringFree() when the result is no longer needed. The format of the path is UTF-8.
Tcl_Chdir changes the applications current working directory to the value specified in dirName. The format of the passed in string must be UTF-8. The function returns -1 on error or 0 on success.