Re: tclkit, starkits, starpacks

From: Arjen Markus (arjen.markus_at_wldelft.nl)
Date: 11/29/04


Date: Mon, 29 Nov 2004 08:52:35 +0100

bob decker wrote:
>

> On Windows I have tried the following. If my main file is prog.tcl, I have
> tried
>
> tclkit.exe sdx.kit qwrap prog.tcl
>
> and then
>
> tclkit.exe sdx.kit unwrap prog.tcl
>
> to get the virtual file system, and then have tried sticking the files that
> are sourced in prog.tcl in various subdirectories under prog.vfs. I then run
> wrap, but to no avail. The resulting prog.kit (starkit) or
> prog.exe(starpack) works on the original system, but not on any others (it
> can't find the sourced files).
>
> Any suggestions? Thanks.
>

My usual way to do this is:
- put the extra source files in the lib/app... directory
- source them using:

   #
   # Auxiliary routines ...
   #
   source [file join [file dirname [info script]] "other_file.tcl"]
 
  from the main code in the main source file (the one that gets
  sourced due to the package require).

This incantation may seem complicated, but if you analyse it, you will
see it is doing the following:
- get the full name of the script that is being sourced (in this case
  the package)
- that will give the directory (wherever that is, through whatever
  VFS manipulations it has to emerge) that holds all the other
  script files as well.

(I do not mean to be "arrogant" or "clever" - I just want to make
the process clearer, as understanding the code is better than
learning it by heart :))

Regards,

Arjen



Relevant Pages

  • Re: Unzip in Tcl?
    ... Have you looked at the virtual file system obtained with ... package require vfs ... It allows you to mount the zip file anywhere in ...
    (comp.lang.tcl)
  • Re: Unzip in Tcl?
    ... Have you looked at the virtual file system obtained with ... package require vfs ... It allows you to mount the zip file anywhere in ...
    (comp.lang.tcl)
  • Re: Want to know when a batch file is done
    ... package of Tcl's VFS and commands like or ... at wiki.tcl.tk before proceeding. ...
    (comp.lang.tcl)
  • gnusim8085: New upstream release 1.3.3
    ... Please update package with the new upstream release 1.3.3. ... -- System Information: ... ii libgnomevfs2-0 1:2.22.0-2ubuntu1 GNOME Virtual File System (runtime ...
    (Ubuntu)