Sending stdout to textArea and a file
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Orhan_Duyar
Posted On:   Wednesday, October 31, 2001 11:45 AM

I am capturing the stdout and sending to a textArea with the following code, but I want to send the same output to a log file. How can I do that? Thank you try { // Fire up the command line process. process = Runtime.getRuntime().exec(args); } catch(IOException e) { System.err.println( "Error creating process... " + e); System.exit(1); } // Get the streams written to by the new Process. InputStream[] inStreams = new InputStream[] { process.getInputStream(), process.getErrorStream()}; ConsoleTextArea cta = new ConsoleTextArea(inStreams);    More>>

I am capturing the stdout and sending to a textArea with the following code, but I want to send the same output to a log file. How can I do that?

Thank you

			

try {
// Fire up the command line process.
process = Runtime.getRuntime().exec(args);
}
catch(IOException e) {
System.err.println(
"Error creating process...
" + e);
System.exit(1);
}

// Get the streams written to by the new Process.
InputStream[] inStreams =
new InputStream[] {
process.getInputStream(),
process.getErrorStream()};

ConsoleTextArea cta = new ConsoleTextArea(inStreams);

   <<Less

Re: Sending stdout to textArea and a file

Posted By:   John_Zukowski  
Posted On:   Saturday, November 3, 2001 11:35 PM

As with all streams, read from the input stream and write to the output stream.
About | Sitemap | Contact