Skip to content
mba105 edited this page Sep 24, 2014 · 2 revisions

Home > [Scripting Reference](Scripting Reference) > os.matchdirs


os.matchdirs

The os.matchdirs function performs a wildcard match to locate one or more directories.

#!lua
matches = os.matchdirs("pattern")

Parameters

pattern is the file system path to search. It may contain single (non-recursive) or double (recursive) asterisk wildcard patterns.

Return Value

A list of directories which match the specified pattern. May be empty.

Example

#!lua
matches = os.matchdirs("src/*")      -- non-recursive match
matches = os.matchdirs("src/**")     -- recursive match
 
matches = os.matchdirs("src/test*")  -- may also match partial names
Clone this wiki locally