2012年9月29日

ruby遍历文件夹

摘要: def get_file_list(path) Dir.entries(path).each do |sub| if sub != '.' && sub != '..' if File.directory?("#{path}/#{sub}") puts "[#{sub}]" get_file_list("#{path}/#{sub}") else puts " |--#{sub}" end end end end 阅读全文

posted @ 2012-09-29 16:07 张飞_ 阅读(2882) 评论(0) 推荐(0)

导航