Returns a list of filenames matching the shell wildcard pattern
pattern. The following characters
and sequences make matches:
Matches any number of
any character (equivalent to the regex pattern
Matches any one
character (equivalent to the regex pattern
For example, to process every JPEG file in a particular directory, you might write:
// do something with $filename
flags value is a bitwise OR of
any of the following values:
Adds a slash to each item returned.
Returns files in the same order as found in the directory itself. If this is not specified, the names are sorted by ASCII value.
If no files matching pattern are found, pattern is returned.
Treat backslashes in pattern as backslashes, rather than as the start of an escape sequence.
In addition to the
normal matches, strings in the form
Returns only directories matching pattern.
Stop on read errors.