Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adding TCL_PACKAGE_PATH directory at execution time [macOS]

32 views
Skip to first unread message

welle...@googlemail.com

unread,
May 3, 2019, 4:48:56 AM5/3/19
to
Hello,

I need to add a different directory at execution time where TCL should find some extensions (in my case Tktable). Standard directories are set at compilation time with TCL_PACKAGE_PATH in configuration file.

In my application, such directory for extension needs to be a relative path (as the application is packed in an application bundle .app and must be self contained).

Before calling TCL, I set an environmental variable TCL_PACKAGE_PATH='path/to/extensions'. Looking at the env variables I can see it has been set, however it has no effect on the directories where TCL looks for extension (which remains the same set in the configuration file).

Is it possible to set this variable at execution time? Or any other suggestion?

Thanks
Welle

stefan

unread,
May 3, 2019, 5:36:53 AM5/3/19
to
> Is it possible to set this variable at execution time? Or any other suggestion?

Are you asking for auto_path?

See https://wiki.tcl-lang.org/page/auto%5Fpath

Stefan

Harald Oehlmann

unread,
May 3, 2019, 9:28:23 AM5/3/19
to
Dear Welle,

yes, you may modify it at execution time.

There are packages and modules:
https://wiki.tcl-lang.org/page/How+to+change+a+running+system

About the relative path:
Relative means, that it depends on current folder (maintained and set by
pwd command). That might work, but may be not the best choice.

I am not sure about ".app" bundles, I suppose this is a starkit or pack
on Linux or Mac-OS.
You may investigate the ::starkit::topdir variable.
If it is relative to the currently sourced file, you may use:

file join [file dirname [info script]] relative/path]

Take care, "info script" only exists within while sourcing. If you need
the folder later, put it in a variable:

set MyFolder [file dirname [info script]]

There might be some errors up there, but you may get the picture.

Hope this helps,
Harald
0 new messages