PDA

View Full Version : Windrop inside ioftpd dir


Mouton
11-11-2003, 06:59 PM
Apparently, as B0unty brought to my attention, putting my windrop directory inside ioftpd (w:\ioftpd\windrop) is NOT cool...
windrop then try to load libraries from w:\ioftpd\lib\tcl8.4 instead of w:\ioftpd\windrop\lib\tcl8.4 ..?

I searched google a little:
auto_path
If set, then it must contain a valid Tcl list giving directories to search during auto-load operations. This variable is initialized during startup to contain, in order: the directories listed in the TCLLIBPATH environment variable, the directory named by the $tcl_library variable, the parent directory of $tcl_library, the directories listed in the $tcl_pkgPath variable.

env(TCL_LIBRARY)
If set, then it specifies the location of the directory containing library scripts (the value of this variable will be assigned to the tcl_library variable and therefore returned by the command info library). If this variable isn't set then a default value is used.putlog "tcl_library = $tcl_library" shows "tcl_library = W:/ioFTPD/lib/tcl8.4" .... uncool...

I checked my environment, and no TCL_LIBRARY is defined... So... since the doc says $tcl_library is filled from the env. variable, and it's not set, I wonder where the W:/ioFTPD/lib/tcl8.4 comes from ..?

Any idea ?

PS To fix, scripts simply has to re-set $auto_path before trying to include any package:
set auto_path "./lib/tcl8.4/ $auto_path"
package require http 2.4
# bingo!

Mouton
11-11-2003, 07:02 PM
Found something else that might answer that:
The initial value of tcl_library is set when an interpreter is created by searching several different directories until one is found that contains an appropriate Tcl startup script.If TCL_LIBRARY isn't set or doesn't refer to an appropriate directory, then Tcl checks several other directories based on a compiled-in default location, the location of the binary containing the application, and the current working directory.Makes one wonder...

Mouton
11-11-2003, 07:42 PM
Apparently, it's not a windrop issue:
W:\ioFTPD\windrop>tclsh84.exe
% info library
W:/ioFTPD/lib/tcl8.4
%Might be something funneh with win32 tcl libraries.

epoke
03-21-2004, 01:14 PM
hum so is it possible to put windrop directory inside ioftpd ?
is there a fix ,trick ?
tia

Mouton
03-21-2004, 01:27 PM
replacing packages ... with source ... works.

epoke
03-21-2004, 02:02 PM
:D erf this mean ...
sorry i don't understood

Harm
03-21-2004, 02:38 PM
It means that all 'package require ...' instructions won't work since the path to the tcl libs is wrong.
BUT that all 'source bla.tcl' instructions will work.

So, you have to replace all 'package require' with 'source'.

Or better, you can avoid this behaviour if you don't have your windrop dir in your ioFTPD dir. ie. c:\windrop is a good location.

mog-on
04-07-2004, 11:40 AM
You can use your tcl's package wherever they are.

You just have to set correctly 'auto_path' before 'package require' using 'lappend auto_path MyLibPath'.

MyLibPath must contain a correct 'pkgIndex.tcl' which can be generated using the command 'pkg_mkIndex' (refer to tcl doc for details)

'source' works obviously ... but this is dirty ;)