File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Dealing with runtime.exec() I/) streams Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Dealing with runtime.exec() I/) streams" Watch "Dealing with runtime.exec() I/) streams" New topic

Dealing with runtime.exec() I/) streams

John Davis
Ranch Hand

Joined: Nov 02, 2000
Posts: 189
I am invoking a communications utility via runtime.exec().

As you can see, I spawn threads to exhaust and print the error and output streams.

If I deliberately screw up the dns name in the pscp command, I do get an error printed out in the streamGobbler thread for PSCP Errors.

But when the pscp command is specified correctly, the process never terminates supposedly because my program is not obtaining and responding to the request for a password.

But this request never shows up in the PSCP output stream?

Any ideas on how I can obtain and respond to the request for a password when invoking pscp in this way?
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

As you can see, ...

No - that's too bad formatted.
You may edit the post - then perhaps I will spend my time reading it.
If you don't spend your time in writing, why should I in reading?
I agree. Here's the link:
subject: Dealing with runtime.exec() I/) streams
It's not a secret anymore!