Home
Ruby
ActiveRecord
Array
CGI
Class
Collections
Database
Date
Design Patterns
Development
File Directory
GUI
Hash
Language Basics
Method
Network
Number
Rails
Range
Reflection
Statement
String
Threads
Time
Tk
Unit Test
Windows Platform
XML
Dir["mydir/**/*"] : Dir « File Directory « Ruby
Ruby
File Directory
Dir
Dir["mydir/**/*"]
p Dir[
"mydir/**/*"
]
Related examples in the same category
1.
more concise way of getting directory listings is by using Dir's class array method
2.
a little more platform independent:
3.
Find all the "regular" files and subdirectories in mydir.
4.
Find all the .rb files in mydir
5.
Dir["mydir/**/*file*"]
6.
Regex-style character classes
7.
Match any of the given strings
8.
Single-character wildcards
9.
Dir with patterns