Perish

博客园 首页 联系 订阅 管理

from_file, to_file = ARGV

script = $0

 

puts "Copying from #{from_file} to #{to_file}"

 

input = File.open(from_file)

indata = input.read()

puts "the input file is #{indata.length} bytes long."

puts "Does the output file exist? #{File.exists? to_file} "

 

puts "Ready , hit RETURN to continue,CTRL-C to abort."

STDIN.gets

output = File.open(to_file,'w')

output.write(indata)

puts "Alright, all done"

output.close()

input.close()

 

 

本文来自

http://lrthw.github.com/ex17/

 

posted on 2012-07-04 16:45  ---小青年---  阅读(174)  评论(0编辑  收藏  举报