From: Ruediger G. <me...@r-...> - 2002-02-05 21:16:11
|
Hello, On Tue, 05 Feb 2002, Jack Jansen was inspired to say: >On Tuesday, February 5, 2002, at 06:52 PM, Ruediger Goetz wrote: > >> Hello, >> >> O.K. >> I followed your suggestions. >> Here is what I found out (I didn't synced to the CSV, yet) >> >> I have Wish Shell.app in /Applications and I could start it >> from the Finder, >> Hence I don't assume that there is something wrong with th permission.. >> I have /usr/bin/wish beeing a hardlink to >> /Applications/Wish\ Shell.app/Contents/MacOS/Wish| Shell. > >Bingo! > >The hardlink is the problem. Whereas a symlink (or a MacOS >alias, to a lesser extent) is really only a pointer to the >destination filename a hardlink is something different: both >hardlinks to the file (the original one and the one you put in >/usr/bin/wish) have the same "status" for the OS. So, if you >execute the program by its /usr/bin/wish name there is no >linkage to the surrounding .app framework. > >You could try replacing the hardlink with a symlink, but I >wouldn't bet the farm on that working either. The wish >application will still get /usr/bin/wish as its argv[0], and >whether it [*] is smart enough to follow symlinks to find the >real location of the binary, and hence the .app magic, remains >to be seen. [*] note that "it" here refers to the hypothetical >Carbon.framework or whatever code that determines we're running >from a .app framework, not to the wish main program. Its not about sym link vs. hard link. I checked it. Sym link and hard link (I assume taht MacOS are sym links under MacOS X) work the same way as in my previous post today, However, >If the symlink doesn't work a two-liner such as this will: >#!/bin/sh >exec "/Applications/yaddayaddayadda/Wish Shell" $@ I put this two liner into /usr/bin/wish. And now everything works expect from > ./test.tcl (If I say works here I mean I really works. The second error I reported today is done, as well :-) ). Obviously the wish-script is not accepted as "shell" bei csh and csh tries to interpret the TCl script by its own. It has to fail. However, this is same on Linux (its nice to have a iBook with OSX and a Yosi wisth Linux at a time ;-) ) However I you replace this script by a this litte C-Programm: #include <stdio.h> int main(int argc, char *argv[]) { char cmd[100000]; // Have a lot of space int i; strcpy(cmd,"/Applications/Wish\\ Shell.app/Contents/MacOS/Wish\\ Shell"); for(i=1;i<argc; i++) { strcat(cmd," "); strcat(cmd,argv[i]); } system(cmd); } And put this into /usr/bin/wish than everything works as expected included Tcl-script with #! . I suggestto add this to the Wish project for installation on /usr/bin/wish. Though the little programm could be improved. I suppose it will be subject to buffer overrun attask (if someone manages to get a commandline of 100000 characters length :-) ) However, one disadvantage is common to both script and c-code. There is an extra process between shell and the Tcl/Tk-interpreter which will consume some resource. Thanks to Jim and Jack for there Help and patience. The next days I will start testing my tix port in detail. I'll keep you informed. Yours R"udiger >-- >- Jack Jansen <Jac...@or...> >http://www.cwi.nl/~jack - >- If I can't dance I don't want to be part of your revolution -- >Emma Goldman - > > >_______________________________________________ >Tcl-mac mailing list >Tc...@li... >https://lists.sourceforge.net/lists/listinfo/tcl-mac -- R"udiger Goetz rg...@r-... WWW: http://www.r-goetz.de Mail send by a Mac running Linux (SuSE-PPC) |