[Starkit] auto_execok and Starpacks
jeffh at ActiveState.com
Mon Aug 8 15:53:14 CEST 2005
Joey Mukherjee wrote:
> Ok, I am just now getting back to this. This being the problem of a
> starpack seeing itself as a directory, not a file.
> Anyway, is this a bug? Will it be fixed? Is there an easy work around?
> One of my programs likes to do things to itself and other programs in
> that directory and now it just ignores itself. Is there a way to get
> the name of the program being run? Maybe I can work around
> it in code?
It's hard to argue whether this is by design or a bug, because
you can come up with good arguments either way. I might be
inclined to say bug, in that the 'auto_execok' proc was never
updated to handle the VFS case. The argument for design is
that, well, you are a directory in the "Tcl" sense, and if you
are looking for yourself and in a starpack, 'info nameofexe'
suffices. Kind of weak, but a solution is even harder, as if
we consider the base case, what about other executables that
might be in a starpack? How do we really know whether to
consider them an exe or not? Do we allow for just the main
starpack? But what if it's just a kit and not a pack? Once
mounted, you can't really be sure.
Jeff Hobbs, The Tcl Guy
http://www.ActiveState.com/, a division of Sophos
> On Jul 6, 2005, at 4:13 PM, Andreas Kupries wrote:
> >> I am creating a starpack and in this pack I use the function
> >> auto_execok to see if programs are in the path. Normally this works
> >> fine, unless the program in question is the program I am currently
> >> running. This is strictly a starpack issue since it works normally
> >> under wish or mktclapp.
> >> Does anyone know why?
> >> You can test this issue by creating a starpack from these two lines:
> >> -- junk.tcl --
> >> puts [auto_execok "junk"]
> >> puts [auto_execok "ls"]
> >> --------------
> > When the starpack 'junk' is running it will see itself as a directory,
> > not a file.
> > [auto_execok] will ignore directories AFAIK.
More information about the Starkit