Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "FAQ Where does System.out and System.err output go"

(New page: == Short answer == *System.out goes to stdout (file descriptor 1) * == A UNIX computer (including clones like Linux, BSD) users file descriptors to define the input and output streams. T...)
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== Short answer ==
+
== Short answer ==
  
*System.out goes to stdout (file descriptor 1)
+
*''System.out ''goes to ''stdout ''(file descriptor 1)  
*
+
*''System.err ''goes to ''stderr ''(file descriptor 2)
  
== A UNIX computer (including clones like Linux, BSD) users file descriptors to define the input and output streams. Three of them are hardcoded by the system and fixed:  ==
+
==  Long Answer ==
  
stdin - the standard input stream has file descriptor 0 stdout - the standard output stream has file descriptor 1 stderr - the standard error stream has file descriptor 2
+
A UNIX computer (including clones like Linux, BSD) users file descriptors to define the input and output streams. Three of them are hardcoded by the system and fixed:
 +
 
 +
*stdin - the standard input stream has file descriptor 0  
 +
*stdout - the standard output stream has file descriptor 1 - this is used by ''System.out''
 +
*stderr - the standard error stream has file descriptor 2 - this is used by ''System.err''
 +
 
 +
Normally stdin, stdout, stderr are initially attached to the console process, but this can be redirected by a programme. E.g. the stderr is redirected to a log file, that is stored separately or watched by another process.

Latest revision as of 15:00, 1 May 2011

Short answer

  • System.out goes to stdout (file descriptor 1)
  • System.err goes to stderr (file descriptor 2)

 Long Answer

A UNIX computer (including clones like Linux, BSD) users file descriptors to define the input and output streams. Three of them are hardcoded by the system and fixed:

  • stdin - the standard input stream has file descriptor 0
  • stdout - the standard output stream has file descriptor 1 - this is used by System.out
  • stderr - the standard error stream has file descriptor 2 - this is used by System.err

Normally stdin, stdout, stderr are initially attached to the console process, but this can be redirected by a programme. E.g. the stderr is redirected to a log file, that is stored separately or watched by another process.

Back to the top