Recent changes Random page
GAMING
Technology
 
Gaming
Entertainment
Science Fiction
Biggest wikis
Hobbies
Music
See more...

Standard error

From Programmer's Wiki

Jump to: navigation, search
 

Standard error is a stream where the program writes its error messages. The following snippets show how to do this using various languages.

Contents


[edit] Snippets

[edit] C

This article is missing a code example in the C language.

[edit] C++

This article is missing a code example in the C++ language.

[edit] C#

This article is missing a code example in the C# language.

[edit] Java

System.err.println("something broke :-(");

[edit] Perl

This article is missing a code example in the Perl language.

[edit] PHP

This article is missing a code example in the PHP language.

[edit] Python

This article is missing a code example in the Python language.

[edit] Ruby

To just write to standard error:

$stderr.puts("Error goes here")

If you want to create an IO object and point that to standard error:

# the file descriptor 2 = standard error
errors = IO.new(2, "w")
errors.puts("Error goes here")

[edit] Tcl

puts stderr "An error message"

[edit] External links

Standard streams at Wikipedia

Rate this article:
Share this article: