[ Previous ] [ Contents ] [ Index ] [ Next ]

Private and Shared Tcl Libraries

Tcl libraries are initialized from both the private and shared Tcl directory specified for each virtual server.

You can specify a private Tcl directory for each virtual server and a shared directory for any group of virtual servers. If you want a Tcl directory containing scripts to be shared by all of your virtual servers, for example, specify that same directory in the SharedLibrary parameter for all of the virtual servers (or leave the SharedLibrary parameter unset and put scripts in the default location).

Note that the private and shared directories you specify need not reside under the AOLserver installation directory. This allows you to keep user-defined scripts physically separate from the scripts supplied by AOLserver, yet still be able to maintain them through the AOLserver script maintenance interface (see Editing Shared and Private Scripts).

If a Tcl script with the same name resides in both the private Tcl directory and the shared Tcl directory for a virtual server, the script in the private Tcl directory is used. This feature allows you to copy shared scripts to a private directory for small modifications specific to that virtual server.


Tcl Script Order of Evaluation
At server startup time, Tcl initialization is performed in the following steps for each virtual server:

  1. If a private Tcl directory is specified, the init.tcl file in that directory is sourced first (if it exists), and then all the remaining .tcl files are sourced alphabetically.

  2. If a shared Tcl directory is specified, the init.tcl file in that directory is sourced first (if it exists and if an init.tcl file does not also exist in the private Tcl directory). Then all .tcl files that are not also in the private Tcl directory are sourced alphabetically.

  3. For each module (including any Tcl-only modules as described on Tcl-only Modules) in the virtual server:

    1. If a private Tcl directory is specified, the init.tcl file in the module-name subdirectory of the private directory is sourced first (if it exists), and then all the remaining .tcl files are sourced alphabetically.

    2. If a shared Tcl directory is specified, the init.tcl file in the module-name subdirectory is sourced first (if it exists and if an init.tcl file does not also exist in the private Tcl directory). Then all .tcl files that are not also in the private Tcl directory are sourced alphabetically.

Editing Shared and Private Scripts

The Tcl administration pages support editing shared and private scripts, and copying shared scripts to the private area. Follow the Tcl Scripting link on the server administration page (/NS/Admin). The relevant options on the Tcl Scripting page are:

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1996 America Online, Inc.