[1587] in java-interest
Re: Q:exec function
daemon@ATHENA.MIT.EDU (Chris Warth)
Fri Sep 8 15:35:09 1995
Date: Fri, 8 Sep 1995 10:07:22 -0700
From: csw@scndprsn.Eng.Sun.COM (Chris Warth)
To: meessen@cppm.in2p3.fr
Cc: java-interest@java.Eng.Sun.COM
> I may have misunderstood the exec function usage but I suspect a limitation.
> It seams impossible to redirect simultaneously stdin stdout and stderr
> of the execed system function.
Nope, you didn't misunderstand. This is not possible in Alpha3. In
fact it is not really possible in Beta either through the direct exec()
call. In Beta a call to exec() will return a Process object which you
can use to get a hold of the stdin, stdout, and stderr, or to wait for
the exit value of the subprocess. However there are platform-specific
subclasses of class Process that you can use to get this redirection.
The only alternative through basic exec(), which was really just meant
for spawning external WWW viewers, is to create the thread whose job it
is to read the stdin of the subprocess and write to wherever you like.
This will be fixed and you should see the new API very soon.
>
> Java should inherit the unix pipe and redirection capabilities.
> Bien cordialement,
We need a solution that works on non-unix machines as well, so our
basic API is brain-dead simple, but you can ask if there is a
platform-specific version of class Process and use that to get more
specific bahavior. Your applet may not then run on a mac or a win3.1
machine, though.
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com