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 

相关文章:

  • 2021-11-24
  • 2021-10-16
  • 2021-06-20
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-02
  • 2022-12-23
相关资源
相似解决方案