tcl::tm::path
tcl::tm::path add ?path ...?
tcl::tm::path remove ?path ...?
tcl::tm::path list
tcl::tm::roots paths
The module path of Tcl modules. A module is a file NAME-VERSION.tm in a folder of the path, with each :: of the package name as a folder, and package require sources it. add puts folders at the head of the path; a folder that is an ancestor or a subfolder of another folder of the path is an error. roots adds ROOT/tcl8/site-tcl and ROOT/tcl8/8.0 to ROOT/tcl8/8.6 for each root. The handler of package unknown searches the path first, then the pkgIndex.tcl files of auto_path.
This page also has tcl::tm::roots, tcl::tm::UnknownHandler.
Examples
foreach p [tcl::tm::path list] {tcl::tm::path remove $p}; tcl::tm::path add /a /b; tcl::tm::path listgives/b /a
Facts
- Capability:
package. A new interpreter does not have this command. See Limits and capabilities. - Compute cost: one compute unit for the call, and more for the commands that it runs.