# simple file copy
# 2011. 1. 7

from = File.open("test.png", "rb:binary")
data = from.read
from.close

to = File.open("test2.png", "wb:binary")
to.write(data)
to.close

* More ruby style code

File.open("test.png", "rb:binary") { |from| $data = from.read }
File.open("test2.png", "wb:binary") { |to| to.write($data) }
Retrieved from http://www.chobocho.com/wiki/moniwiki/wiki.php?FileCopy
last modified 2011-01-07 23:53:00