Skip to content

Instantly share code, notes, and snippets.

@shinokada
Created May 28, 2014 00:24
Show Gist options
  • Save shinokada/e5c1ed3475920d585008 to your computer and use it in GitHub Desktop.
Save shinokada/e5c1ed3475920d585008 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
# http://zetcode.com/lang/rubytutorial/io/
$stdout = File.open "output.log", "a" # redirect a standard output to a log file.
puts "Ruby"
puts "Java"
$stdout.close
$stdout = STDOUT # Use predefined standard constant STDOUT to recreate the normal standard output
puts "Python"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment