2 '\" Copyright (c) 1998-1999 Scriptics Corportation
4 '\" See the file "license.terms" for information on usage and redistribution
5 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10 .TH Tcl_GetCwd 3 8.1 Tcl "Tcl Library Procedures"
13 Tcl_GetCwd, Tcl_Chdir \- manipulate the current working directory
16 \fB#include <tcl.h>\fR
19 \fBTcl_GetCwd\fR(\fIinterp\fR, \fIbufferPtr\fR)
22 \fBTcl_Chdir\fR(\fIpath\fR)
24 .AS Tcl_DString *bufferPtr
25 .AP Tcl_Interp *interp in
26 Interpreter in which to report an error, if any.
27 .AP Tcl_DString *bufferPtr in/out
28 This dynamic string is used to store the current working directory.
29 At the time of the call it should be uninitialized or free. The
30 caller must eventually call \fBTcl_DStringFree\fR to free up
33 File path in UTF\-8 format.
38 These procedures may be used to manipulate the current working
39 directory for the application. They provide C\-level access to
40 the same functionality as the Tcl \fBpwd\fR command.
42 \fBTcl_GetCwd\fR returns a pointer to a string specifying the current
43 directory, or NULL if the current directory could not be determined.
44 If NULL is returned, an error message is left in the interp's result.
45 Storage for the result string is allocated in bufferPtr; the caller
46 must call \fBTcl_DStringFree()\fR when the result is no longer needed.
47 The format of the path is UTF\-8.
49 \fBTcl_Chdir\fR changes the applications current working directory to
50 the value specified in \fIpath\fR. The format of the passed in string
51 must be UTF\-8. The function returns -1 on error or 0 on success.