【发布时间】:2013-07-02 09:02:58
【问题描述】:
我编写此代码是为了将文件从一个位置复制到另一个位置,但我想将整个文件夹的内容复制到目标位置。
我该怎么做?我尝试了 file.copy dir,但它不起作用。
require 'ftools'
fname = gets.chomp
if fname == "android" then
File.copy "/Volumes/TempData/Collects/Sasi/android/grade.rb","/Volumes/Data"
elsif fname == "ios" then
File.copy"/Volumes/Sasi/ios/grade.rb","/Volumes/TempData/Sasi/KugaViewr/grade.rb"
else
puts "do nothing"
end
【问题讨论】: