Re: Runtime.getRuntime().exec()
Re: Runtime.getRuntime().exec()
- Subject: Re: Runtime.getRuntime().exec()
- From: Adam Czysciak <email@hidden>
- Date: Thu, 18 Aug 2005 08:15:29 +0200
On Aug 18, 2005, at 2:46 AM, George Domurot wrote:
I'm attempting to call an executable from within WO. The command works
fine through the terminal, but not when called via WO. I can call
basic commands like "ls" without issue from within WO. I'm thinking
there may be a permission issue with executables.
I suppose your command outputs too much characters, and then your WO
app hangs. Watch this (taken from java.lang.Process API):
The Runtime.exec methods may not work well for special processes on
certain native platforms, such as native windowing processes, daemon
processes, Win16/DOS processes on Microsoft Windows, or shell scripts.
The created subprocess does not have its own terminal or console. All
its standard io (i.e. stdin, stdout, stderr) operations will be
redirected to the parent process through three streams
(Process.getOutputStream(), Process.getInputStream(),
Process.getErrorStream()). The parent process uses these streams to
feed input to and get output from the subprocess. Because some native
platforms only provide limited buffer size for standard input and
output streams, failure to promptly write the input stream or read the
output stream of the subprocess may cause the subprocess to block, and
even deadlock.
The quickest solution would be to use some "silent" app mode (eg "-q"
for unzip).
--
Regards,
Adam Czysciak - email@hidden
Power Media - http://www.power.com.pl
Sun Certified Programmer for the Java 2 Platform, SE 5.0
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden