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

Reply via email to