Sponsored Content
Full Discussion: Help
Top Forums Programming Help Post 302191710 by redhead on Sunday 4th of May 2008 02:28:34 PM
Old 05-04-2008
If you want to use some system environments, then the getenv(3) system call would be preferede:
Code:
  #include <stdlib.h>
  char *getenv(const char *name);

If it's something like the current directory, getcwd(3) might be what you're looking for
Code:
  #include <unistd.h>
  char *getcwd(char *buf, size_t size);
  char *get_current_dir_name(void);
  char *getwd(char *buf);

 
Tcl_GetCwd(3)						      Tcl Library Procedures						     Tcl_GetCwd(3)

__________________________________________________________________________________________________________________________________________________

NAME
Tcl_GetCwd, Tcl_Chdir - manipulate the current working directory SYNOPSIS
#include <tcl.h> char * Tcl_GetCwd(interp, bufferPtr) int Tcl_Chdir(path) ARGUMENTS
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. _________________________________________________________________ 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 path. The format of the passed in string must be UTF-8. The function returns -1 on error or 0 on success. KEYWORDS
pwd Tcl 8.1 Tcl_GetCwd(3)
All times are GMT -4. The time now is 12:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy