ADC Home > Reference Library > Reference > Mac OS X > Mac OS X Man Pages

 

This document is a Mac OS X manual page. Manual pages are a command-line technology for providing documentation. You can view these manual pages locally using the man(1) command. These manual pages come from many different sources, and thus, have a variety of writing styles.

This manual page is associated with the Mac OS X developer tools. The software or headers described may not be present on your Mac OS X installation until you install the developer tools package. This package is available on your Mac OS X installation DVD, and the latest versions can be downloaded from developer.apple.com.

For more information about the manual page format, see the manual page for manpages(5).



Tcl_TranslateFileName(3)                   Tcl Library Procedures                   Tcl_TranslateFileName(3)



____________________________________________________________________________________________________________

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 nonNULL
       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_TranslateFileName   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 interpreter'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



Tcl                                                  8.1                            Tcl_TranslateFileName(3)

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.