NAME
TclTranslateFileName - convert file name to native form and replace
tilde with home directorySYNOPSIS
##iinncclluuddee <
char * TTccllTTrraannssllaatteeFFiilleeNNaammee(interp, name, bufferPtr) AARRGGUUMMEENNTTSS TclInterp *interp (in) Interpreter in which to report an error, if any. CONST char *name (in) File name, which may start with a ``~''. TclDString *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> TTccllDDSSttrriinnggFFrreeee to free up any-
thing 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 TTccllTTrraannssllaatteeFFiilleeNNaammee has to do tilde substitution or translate the name then it uses the dynamic string at *bufferPtr to hold the newstring it generates. After TTccllTTrraannssllaatteeFFiilleeNNaammee returns a non-NULL
result, the caller must eventually invoke TTccllDDSSttrriinnggFFrreeee to free any information placed in *bufferPtr. The caller need not know whether ornot TTccllTTrraannssllaatteeFFiilleeNNaammee actually used the string; TTccllTTrraannssllaatteeFFiillee-
NNaammee initializes *bufferPtr even if it doesn't use it, so the call to TTccllDDSSttrriinnggFFrreeee 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, TTccllTTrraannssllaatteeFFiilleeNNaammee frees the dynamic string itself so that the caller need not call TTccllDDSSttrriinnggFFrreeee. The caller is responsible for making sure that the interpreter's result has its default empty value when TTccllTTrraannssllaatteeFFiilleeNNaammee is invoked.SEE ALSO
filename KKEEYYWWOORRDDSS file name, home directory, tilde, translate, user Tcl 8.1 TclTranslateFileName(3)