Commit b3f0ef5d by Đường Sỹ Hoàng

More files

parent 18384cf5
Pipeline #112 canceled with stages
in 0 seconds
from_file, to_file = ARGV
puts "Copying from #{from_file} to #{to_file}"
# we could do these two on one line, how?
in_file = open(from_file)
indata = in_file.read
puts "The input file is #{indata.length} bytes long"
puts "Does the output file exist? #{File.exist?(to_file)}"
puts "Ready, hit RETURN to continue, CTRL-C to abort."
$stdin.gets
out_file = open(to_file, 'w')
out_file.write(indata)
puts "Alright, all done."
out_file.close
in_file.close
\ No newline at end of file
This a test file.
This a test file.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment