Skip to content

Instantly share code, notes, and snippets.

@latpaw
Created June 28, 2012 16:45
Show Gist options
  • Save latpaw/3012430 to your computer and use it in GitHub Desktop.
Save latpaw/3012430 to your computer and use it in GitHub Desktop.
递归遍历文件夹
def yue(dir)
Dir::foreach(dir) do |file|
if file.eql? "." or file.eql? ".."
nil
else
if File.directory? dir+"/"+file
yue(dir+"/"+file)
else
puts dir+"/"+file
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment