[Tcl Java] RE: [Tcl Java] Re: [Tcl Java] exec command
I think, actually, that in 1.2 at least if the System property "user.dir" is set appropriately that is where the Runtime.exec() takes place. I modified Interp.setWorkingDir() appropriately (which is called by CdCmd.java): if (dirObj.isDirectory()) { workingDir = dirObj; System.setProperty( "user.dir", dirObj.getPath() ); } else { throw new TclException(this, "couldn't change working directory to \"" + dirObj.getName() + "\": no such file or directory"); } If this was the only problem with the Runtime.exec() this should solve it. If I remember correctly, however, it was more complicated than that in early versions of 1.2. Didn't it hang due to the I/O thread hanging? > -Original Message- > From: Mo DeJong [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 13, 2000 7:59 PM > To: Levine Justin-p94702 > Cc: '[EMAIL PROTECTED]' > Subject: [Tcl Java] Re: [Tcl Java] exec command > > > On Tue, 13 Jun 2000, Levine Justin-p94702 wrote: > > > Hello, > > > > I was using JDK 1.3, but it still wasn't working properly. I > gave up and > > just started using the Runtime class. > > Thanks. > > I have never tested it under 1.3. The exec class has this huge hack > in it to get around the fact that the exec() did not let you > tell the system what directory to run the command from. There > is no chdir() in Java, so the combo of these things makes it > next to impossible to exec() correctly from a JVM. The new > exec() API in 1.3 should fix this. Why don't you fix up > the ExecCmd.java file for Jacl and send in a patch? > > Mo DeJong > Red Hat Inc > > > The TclJava mailing list is sponsored by Scriptics Corporation. > 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]'. > An archive is available at > http://www.mail-archive.com/tcljava@scriptics.com > The TclJava mailing list is sponsored by Scriptics Corporation. 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]'. An archive is available at http://www.mail-archive.com/tcljava@scriptics.com
[Tcl Java] Re: [Tcl Java] exec command
On Tue, 13 Jun 2000, Levine Justin-p94702 wrote: > Hello, > > I was using JDK 1.3, but it still wasn't working properly. I gave up and > just started using the Runtime class. > Thanks. I have never tested it under 1.3. The exec class has this huge hack in it to get around the fact that the exec() did not let you tell the system what directory to run the command from. There is no chdir() in Java, so the combo of these things makes it next to impossible to exec() correctly from a JVM. The new exec() API in 1.3 should fix this. Why don't you fix up the ExecCmd.java file for Jacl and send in a patch? Mo DeJong Red Hat Inc The TclJava mailing list is sponsored by Scriptics Corporation. 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]'. An archive is available at http://www.mail-archive.com/tcljava@scriptics.com
[Tcl Java] Re: [Tcl Java] exec command
Hello, I was using JDK 1.3, but it still wasn't working properly. I gave up and just started using the Runtime class. Thanks. - Justin -Original Message- From: Mo DeJong [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 13, 2000 1:43 PM To: Levine Justin-p94702 Cc: '[EMAIL PROTECTED]' Subject: [Tcl Java] Re: [Tcl Java] exec command It depends on what JDK you are using. If you are having problems with a JDK 1.1 release from Sun, forget about it. JDK 1.2 seems to work better, but that is still not great. Have you tried the IBM JDK? That might work better than the Sun one. Sun does not seem to do a very good job of fixing bugs in the JDK. Just take a look at the exec implementation in Jacl if you want a good scare. By the way, JDK 1.3 has a new exec() API that fixes most of these problems, but it took so long to get in that I never got around to adding it back to Jacl. I filed a bug report with Sun, and it took them someting like 2 years to fix the problem. Mo DeJong Red Hat Inc The TclJava mailing list is sponsored by Scriptics Corporation. 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]'. An archive is available at http://www.mail-archive.com/tcljava@scriptics.com
[Tcl Java] Re: [Tcl Java] exec command
On Tue, 13 Jun 2000, Levine Justin-p94702 wrote: > I have spent some time, and have come up empty. I'm currently using Jacl to > try to run batch files on an NT system. However, no matter what I do with > that exec command, it merely flips up a cmd.exe window for a moment, and > then disposes of it. I tried CALLing and STARTing, and all other sorts of > nonsense. > > Could someone just show me an example of running a batch file from a jacl > script? It depends on what JDK you are using. If you are having problems with a JDK 1.1 release from Sun, forget about it. JDK 1.2 seems to work better, but that is still not great. Have you tried the IBM JDK? That might work better than the Sun one. Sun does not seem to do a very good job of fixing bugs in the JDK. Just take a look at the exec implementation in Jacl if you want a good scare. By the way, JDK 1.3 has a new exec() API that fixes most of these problems, but it took so long to get in that I never got around to adding it back to Jacl. I filed a bug report with Sun, and it took them someting like 2 years to fix the problem. Mo DeJong Red Hat Inc The TclJava mailing list is sponsored by Scriptics Corporation. 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]'. An archive is available at http://www.mail-archive.com/tcljava@scriptics.com
[Tcl Java] exec command
I have spent some time, and have come up empty. I'm currently using Jacl to try to run batch files on an NT system. However, no matter what I do with that exec command, it merely flips up a cmd.exe window for a moment, and then disposes of it. I tried CALLing and STARTing, and all other sorts of nonsense. Could someone just show me an example of running a batch file from a jacl script? Thanks. - Justin The TclJava mailing list is sponsored by Scriptics Corporation. 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]'. An archive is available at http://www.mail-archive.com/tcljava@scriptics.com