On Sun, 21 Mar 1999, Christopher Hylands wrote:

Yeah, it works for me too, sometimes.

> The Jacl exec command works for me under JDK1.2/NT4.0.

Perhaps that error message should be changed. I do not remember if
it was a Tcl compat issue.

> One thing is that inside ExecCmd, we are throwing away the detail
> message of the exception that is being thrown.
> 
> Currently, the code says:
>     } catch (IOException e) {
>         //if exec fails we end up catching the exception here
> 
>       throw new TclException(interp, "couldn't execute \"" +
>               argv[firstWord].toString() + "\": no such file or directory");

I think I assumed C:\Temp already exists. It should not be too hard
to check and create the C:\Temp directory using the File class.

> The error message is not always true, for example
> the execWin method expects that c:\temp is a writable directory.
> Unfortunately, on my machine NT is installed on d: and c:\temp did
> not exist until I created it.
> 
> As a result 'exec ls' was failing with the message:
>    couldn't execute "ls": no such file or directory
> 
> when in fact the problem was that the directory did not exist.
> When I added the detail message on to the end of the TclException, it
> was instantly obvious what the problem was.
> 
> % exec ls
> couldn't execute "ls": no such file or directory: java.io.FileNotFoundException: 
>C:\TEMP\jacl1.bat (The system cannot find the path specified)

The ugly code is a combination of the ugly JDK exec() implementation
and the hacks needed to exec 32 bit programs under NT. Trust me,
exec on NT does not work any other way (under JDK 1.1 I mean).

later
mo

> In general, this code does seem a little convoluted though.  It would
> be good to have another look at it.
> 
> -Christopher
> 
> --------
> 
>     Well, yes and no. Exec on NT and 95 is really a mess. The problem
>     is not with the Jacl code but with the Sun implementation of
>     java.lang.Runtime.exec(). I assume from the error you are getting
>     that you are running JDK 1.1. JDK 1.2 fixes some of these exec problems
>     but also adds other problems so that is not a perfect fix. I have
>     been able to run the exec tests cases on a NT box here in the lab
>     but NT is really strange and the tests do not always work. It took
>     a lot of testing and debugging just to get the jacl exec to the point
>     it is now (take a look at the Jacl exec source, it is ugly). To be
>     honest, I do not think I am going to be spending any more time
>     getting exec working under NT or 95. If anyone else wants to work
>     on the problem I would be happy to give out my test cases.
>     
>     Mo DeJong
>     gimme multimedia group
>     
>     On Fri, 19 Mar 1999, Sachin Thatte wrote:
>     
>     > 
>     > Hi,
>     > 
>     > Is the exec command on JACL shell supposed to work? It gives me error
>     > when I try to run it. I am using JACL 1.1.1 on NT. Following are
>     > examples. Any help is appreciated.
>     > 
>     > 
>     > % exec c:/WINNT/SYSTEM32/CMD.EXE
>     > couldn't execute "c:/WINNT/SYSTEM32/CMD.EXE": no such file or directory
>     > % exec cmd
>     > couldn't execute "cmd": no such file or directory
>     > % exec cmd.exe
>     > couldn't execute "cmd.exe": no such file or directory
>     > % exec cmd dir
>     > couldn't execute "cmd": no such file or directory
>     > 
>     > 
>     > Thanks,
>     > 
>     > -Sachin
>     > 
>     > 
>     > ----------------------------------------------------------------
>     > The TclJava mailing list is sponsored by WebNet Technologies.
>     > To subscribe:    send mail to [EMAIL PROTECTED]  
>     >                  with the word SUBSCRIBE as the subject.
>     > To unsubscribe:  send mail to [EMAIL PROTECTED] 
>     >                  with the word UNSUBSCRIBE as the subject.
>     > To send to the list, send email to '[EMAIL PROTECTED]'. 
>     > A list archive is at: http://www.findmail.com/listsaver/tcldallas/
>     > 
>     
>     ----------------------------------------------------------------
>     The TclJava mailing list is sponsored by WebNet Technologies.
>     To subscribe:    send mail to [EMAIL PROTECTED]  
>                      with the word SUBSCRIBE as the subject.
>     To unsubscribe:  send mail to [EMAIL PROTECTED] 
>                      with the word UNSUBSCRIBE as the subject.
>     To send to the list, send email to '[EMAIL PROTECTED]'. 
>     A list archive is at: http://www.findmail.com/listsaver/tcldallas/
> --------
> 

----------------------------------------------------------------
The TclJava mailing list is sponsored by WebNet Technologies.
To subscribe:    send mail to [EMAIL PROTECTED]  
                 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
                 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
A list archive is at: http://www.findmail.com/listsaver/tcldallas/

Reply via email to