ファイルコピー(上書きしない)
sce_path = /home/hoge tgt_path = /home/fuga Dir::glob(src_path + "/*").each {|f| # fにはフルパスが入る if (FileTest.file?(f) == false) then next end if (FileTest.exist?(tgt_path + "/" + File::basename(f)) == true) then next end FileUtils.cp(f, $tgt_path + "/") printf("copy : %s \n => %s\n", f, $tgt_path) }