Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tcl_translatefilename(3tcl) [opensolaris man page]

Tcl_TranslateFileName(3TCL)				      Tcl Library Procedures				       Tcl_TranslateFileName(3TCL)

__________________________________________________________________________________________________________________________________________________

NAME
Tcl_TranslateFileName - convert file name to native form and replace tilde with home directory SYNOPSIS
#include <tcl.h> char * Tcl_TranslateFileName(interp, name, bufferPtr) ARGUMENTS
Tcl_Interp *interp (in) Interpreter in which to report an error, if any. CONST char *name (in) File name, which may start with a ``~''. Tcl_DString *bufferPtr (in/out) If needed, this dynamic string is used to store the new file name. 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. _________________________________________________________________ DESCRIPTION
This utility procedure translates a file name to a form suitable for passing to the local operating system. It converts network names into native form and does tilde substitution. If Tcl_TranslateFileName has to do tilde substitution or translate the name then it uses the dynamic string at *bufferPtr to hold the new string it generates. After Tcl_TranslateFileName returns a non-NULL result, the caller must eventually invoke Tcl_DStringFree to free any information placed in *bufferPtr. The caller need not know whether or not Tcl_TranslateFileName actually used the string; Tcl_Translate- FileName initializes *bufferPtr even if it doesn't use it, so the call to Tcl_DStringFree will be safe in either case. If an error occurs (e.g. because there was no user by the given name) then NULL is returned and an error message will be left in the inter- preter's result. When an error occurs, Tcl_TranslateFileName frees the dynamic string itself so that the caller need not call Tcl_DStringFree. The caller is responsible for making sure that the interpreter's result has its default empty value when Tcl_TranslateFileName is invoked. SEE ALSO
filename KEYWORDS
file name, home directory, tilde, translate, user ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWTcl | +--------------------+-----------------+ |Interface Stability | Uncommitted | +--------------------+-----------------+ NOTES
Source for Tcl is available on http://opensolaris.org. Tcl 8.1 Tcl_TranslateFileName(3TCL)

Check Out this Related Man Page

Tcl_GetCwd(3TCL)					      Tcl Library Procedures						  Tcl_GetCwd(3TCL)

__________________________________________________________________________________________________________________________________________________

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 ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWTcl | +--------------------+-----------------+ |Interface Stability | Uncommitted | +--------------------+-----------------+ NOTES
Source for Tcl is available on http://opensolaris.org. Tcl 8.1 Tcl_GetCwd(3TCL)
Man Page