Seth Woolley's Man Viewer

Translate(3) - Tcl_TranslateFileName, Tcl_TranslateFileName - convert file name to native form and replace tilde with home directory - man 3 Translate

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

Tcl_TranslateFileName(3)    Tcl Library Procedures    Tcl_TranslateFileName(3)

       Tcl_TranslateFileName  -  convert  file(1,n) name to native form and replace
       tilde with home directory

       #include <tcl.h>

       char *
       Tcl_TranslateFileName(interp, name, bufferPtr)

       Interpreter in(1,8) which to report an error(8,n), if(3,n) any.  File name, which  may
       start  with  a  ``~''.  If needed, this dynamic string(3,n) is used to store
       the new file(1,n) name.  At the time(1,2,n) of the call it should be  uninitialized
       or  free.   The  caller must eventually call Tcl_DStringFree to free up
       anything stored here.

       This utility procedure translates a file(1,n) 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(3,n) at *bufferPtr to hold the new
       string(3,n) it generates.  After Tcl_TranslateFileName  returns  a  non-NULL
       result,  the  caller must eventually invoke Tcl_DStringFree to free any
       information placed in(1,8) *bufferPtr.  The caller need not know whether  or
       not Tcl_TranslateFileName actually used the string(3,n);  Tcl_TranslateFile-
       Name initializes *bufferPtr even if(3,n) it doesn't use it, so the  call  to
       Tcl_DStringFree will be safe in(1,8) either case.

       If  an  error(8,n) occurs (e.g. because there was no user by the given name)
       then NULL is returned and an error(8,n) message will be left in(1,8)  the  inter-
       preter's result.  When an error(8,n) occurs, Tcl_TranslateFileName frees the
       dynamic string(3,n) 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.


       file(1,n) name, home directory, tilde, translate, user

Tcl                                   8.1             Tcl_TranslateFileName(3)

References for this manual (incoming links)