{"id":7199,"date":"2022-12-20T19:35:48","date_gmt":"2022-12-20T22:35:48","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/tcl_translatefilename-man3\/"},"modified":"2022-12-20T19:35:48","modified_gmt":"2022-12-20T22:35:48","slug":"tcl_translatefilename-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/tcl_translatefilename-man3\/","title":{"rendered":"Tcl_TranslateFileName (man3)"},"content":{"rendered":"<h1 align=\"center\">Tcl_TranslateFileName<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#ARGUMENTS\">ARGUMENTS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#KEYWORDS\">KEYWORDS<\/a> <\/p>\n<hr>\n<p>______________________________________________________________________________<\/p>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_TranslateFileName \u2212 convert file name to native form and replace tilde with home directory<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <tcl.h><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">char bodies manpages.csv script_extrae_body.sh script.sh usr <b><br \/> Tcl_TranslateFileName<\/b>(<i>interp<\/i>, <i>name<\/i>, <i>bufferPtr<\/i>)<\/p>\n<h2>ARGUMENTS <a name=\"ARGUMENTS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"47%\">\n<p style=\"margin-top: 1em\">Tcl_Interp <i>*interp<\/i> (in)<\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"32%\">\n<p style=\"margin-top: 1em\">Interpreter in which to report an error, if any.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"47%\">\n<p>const char <i>*name<\/i> (in)<\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"32%\">\n<p>File name, which may start with a \u201c~\u201d.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"47%\">\n<p>Tcl_DString <i>*bufferPtr<\/i> (in\/out)<\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"32%\">\n<p>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 <b>Tcl_DStringFree<\/b> to free up anything stored here.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:68%;\">______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This utility procedure translates a file name to a platform-specific form which, after being converted to the appropriate encoding, is suitable for passing to the local operating system. In particular, it converts network names into native form and does tilde substitution.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">However, with the advent of the newer <b>Tcl_FSGetNormalizedPath<\/b> and <b>Tcl_FSGetNativePath<\/b>, there is no longer any need to use this procedure. In particular, <b>Tcl_FSGetNativePath<\/b> performs all the necessary translation and encoding conversion, is virtual-filesystem aware, and caches the native result for faster repeated calls. Finally <b>Tcl_FSGetNativePath<\/b> does not require you to free anything afterwards.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If <b>Tcl_TranslateFileName<\/b> has to do tilde substitution or translate the name then it uses the dynamic string at <i>*bufferPtr<\/i> to hold the new string it generates. After <b>Tcl_TranslateFileName<\/b> returns a non-NULL result, the caller must eventually invoke <b>Tcl_DStringFree<\/b> to free any information placed in <i>*bufferPtr<\/i>. The caller need not know whether or not <b>Tcl_TranslateFileName<\/b> actually used the string; <b>Tcl_TranslateFileName<\/b> initializes <i>*bufferPtr<\/i> even if it does not use it, so the call to <b>Tcl_DStringFree<\/b> will be safe in either case.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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\u2019s result. When an error occurs, <b>Tcl_TranslateFileName<\/b> frees the dynamic string itself so that the caller need not call <b>Tcl_DStringFree<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The caller is responsible for making sure that the interpreter\u2019s result has its default empty value when <b>Tcl_TranslateFileName<\/b> is invoked.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">filename(n)<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">file name, home directory, tilde, translate, user<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Tcl_TranslateFileName \u2212 convert file name to native form and replace tilde with home directory <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2536],"tags":[2538,3007,3530],"class_list":["post-7199","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-man3","tag-tcl_translatefilename"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7199"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7199\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}