File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To where is standard output being written?

 
d jones
Ranch Hand
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to determine where java is writing its standard output?

If we start a program with "java testProgram > logfile.log"

Is it possible to identify in the program that it is writing its standard output to a file called logfile.log?

Many Thanks
 
Peter Chase
Ranch Hand
Posts: 1970
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, not with Pure Java anyway. The redirection is being done by the operating system, so Java does not know about it.

If it was really, really important to you, it might be possible to find out, using either native code (JNI) or external processes (Runtime.exec()). Neither approach is portable or attractive.

Why do you want this information?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic