The Artima Developer Community
Sponsored Link

Java Answers Forum
Show c commnads in java

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
patuco s.

Posts: 12
Nickname: patuco
Registered: Feb, 2006

Show c commnads in java Posted: Feb 22, 2006 1:11 PM
Reply to this message Reply
Advertisement
Hi,
i have redirectioned the java outoup to write in a file, it reacts perfectly to the system.out but when the new outpot becomes a printf nothing happens.
It would be super if anyone who face with this, could help me
Thanks.

The code is:

final PrintStream sysOut = new PrintStream(System.out);


try {
// Tee standard output
PrintStream out = new PrintStream(new FileOutputStream("out.log"));
PrintStream tee = new TeeStream(System.out, out);

System.setOut(tee);

// Tee standard error
PrintStream err = new PrintStream(new FileOutputStream("err.log"));
tee = new TeeStream(System.err, err);

System.setErr(tee);
} catch (FileNotFoundException e) {
}

// Write to standard output and error and the log files
System.out.println("welcome");

Topic: java virtual installer. Program will exit ....Please please help! Previous Topic   Next Topic Topic: Email Link to carry the form values to the Specified mail Id

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use