Does anyone know if there\'s an existing module/function inside Ruby to traverse file system directories and files? I\'m looking for something similar to Python\'s os
os
require 'pathname' def os_walk(dir) root = Pathname(dir) files, dirs = [], [] Pathname(root).find do |path| unless path == root dirs << path if path.directory? files << path if path.file? end end [root, files, dirs] end root, files, dirs = os_walk('.')