Re: Tcl source command directory



Ray wrote:
I tend to build up and use the absolute pathname instead of relative
ones.
In each called script, put:

set scriptName [file tail [set scriptPath [info script]]]
set basedir [file dirname $scriptPath]
source [file join $basedir <your-libname-here>]


The above code produces a relative path not an absolute one. You need to change your source to read:

source [file normalize [file join $basedir <your-libname-here>]]

--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
.



Relevant Pages

  • Re: Path info for VBscript from HTM page
    ... if my_file.html (with a script in it) how do I retrieve its absolute ... > relative path, when it can sit on my PC or the Website with my provider ...
    (microsoft.public.scripting.vbscript)
  • Re: Tcl source command directory
    ... I tend to build up and use the absolute pathname instead of relative ... In each called script, put: ... set basedir [file dirname $scriptPath] ...
    (comp.lang.tcl)
  • Re: reference to a subroutine in @INC
    ... > relative path with respect to the script. ... but the perl still complains that it cannot ... have your modules install into the classic CPAN section ...
    (perl.beginners)
  • Re: tie() with DB_File not tie()ing ?
    ... this particular script is a utility script that is used for a ... enough that DB_File cant figure it out and tie() to it. ... relative path, the fact must be that the current directory, by the ... I sure dont see how the current directory could change between one ...
    (comp.lang.perl.misc)
  • include within include, using a relatve path
    ... If you include a script that itself contains an include command using ... not that of the script in which the relative path ... Say there is an include script doing database access and some more setup, ... slash as a delimiter of the regular expression, ...
    (comp.lang.php)