1. Tech

Your suggestion is on its way!

An email with a link to:


was emailed to:

Thanks for sharing About.com with others!

Linux / Unix Command: Tcl_GetCwd
Command Library


Tcl_GetCwd, Tcl_Chdir - manipulate the current working directory  


#include <tcl.h>

char *
Tcl_GetCwd(interp, bufferPtr)



Tcl_Interp    *interp    (in)
Interpreter in which to report an error, if any.
Tcl_DString    *bufferPtr    (in/out)
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.
char    *path    (in)
File path in UTF-8 format.



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 path. The format of the passed in string must be UTF-8. The function returns -1 on error or 0 on success.




Important: Use the man command (% man) to see how a command is used on your particular computer.

>> Linux/Unix Command Library

>> Shell Command Library

Explore Linux
By Category
    linuxLinuxcomputeTechb0502bb1540001006c84963cb0502bb1540002006c818e0ahttp://linux.about.comod526F6F74132058liveGary Newelllinuxguide3TO004KpzNIP11970-01-0110/od/index.htm0526F6F741approved/od
  1. About.com
  2. Tech
  3. Linux

©2016 About.com. All rights reserved.