RosettaCodeData/Task/File-input-output/Ruby/file-input-output-2.rb

5 lines
158 B
Ruby

# Only if 'input.txt' is a text file!
# Only if pipe '|' is not first character of path!
str = IO.read('input.txt')
open('output.txt', 'w') {|f| f.write str}