prune under file basename : Find « File Directory « Ruby
- Ruby
- File Directory
- Find
prune under file basename
require 'find'
Find.find('./') do |path|
if File.basename(path) =~ /file2$/
puts "PRUNED #{path}"
Find.prune
end
puts path
end
Related examples in the same category