#encoding: gbk require 'find' print "输入目录:" path=gets.chomp! print "输入后缀名:" basename=gets.chomp! Find.find("#{path}") do |d| if d.include?(".torrent") puts "[INFO]删除文件#{d}" end end