Tcl_GetCwd(3tcl)

πŸ“¦
version 9.0.4 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– Tcl_GetCwd β€” the "where am I tho" page πŸ’–

okay bestie, welcome to Tcl_GetCwd(3tcl) from the Tcl Library Procedures ✨ this one's all about the two lil C functions that mess with your current working directory. group chat energy, but make it pwd. 🫢


✨ NAME ✨

Tcl_GetCwd, Tcl_Chdir β€” manipulate the current working directory 🌸


πŸŽ€ SYNOPSIS πŸŽ€

#include <tcl.h>

char *
Tcl_GetCwd(interp, bufferPtr)

int
Tcl_Chdir(dirName)

πŸ¦‹ ARGUMENTS πŸ¦‹

  • Tcl_Interp *interp (in) β€” the interpreter where we drop an error message if something goes wrong, iykyk. πŸ™ˆ
  • Tcl_DString *bufferPtr (in/out) β€” this dynamic string is where the current working directory gets stored. at the time of the call it should be uninitialized or free, no cap. and the caller must eventually call Tcl_DStringFree to free up anything stored here β€” that's your cleanup era, don't skip it. πŸ’…
  • const char *dirName (in) β€” file path in UTF-8 format. periodt.

🌈 DESCRIPTION 🌈

These procedures may be used to manipulate the current working directory for the application. they're giving C-level access to the same functionality as the Tcl pwd command β€” main character energy, but in C. πŸ‘‘

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 application's 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. slay. βœ…


⭐ KEYWORDS ⭐

pwd


and that's the whole page, bestie πŸŽ€ this was Tcl 8.1, filed under Tcl_GetCwd(3tcl) β€” go change directories responsibly, mwah πŸ’–

πŸ“¦ where this page comes from