开发者

Ruby -> get all files in directories

开发者 https://www.devze.com 2023-04-10 05:03 出处:网络
I want to get a list of all files in a directory that contain multiple sub-directories (and p开发者_如何学编程ossible more sub-directories within them)

I want to get a list of all files in a directory that contain multiple sub-directories (and p开发者_如何学编程ossible more sub-directories within them)

How can I do this using Ruby on my Mac OS X?

Thanks


Something like this should work

Dir["**/*"].select{|x| !File.directory?(x)}
0

精彩评论

暂无评论...
验证码 换一张
取 消