This module contains utilities on a higher level than the
This module does not support "raw" file names (i.e. files whose names do not comply with the expected encoding). Such files will be ignored by the functions in this module.
For more information about raw file names, see the
The
Returns
The
The
If Unicode file name translation is in effect and the file
system is completely transparent, file names that cannot be
interpreted as Unicode may be encountered, in which case the
For more information about raw file names, see the
The
The
The
The
The
The wildcard string looks like an ordinary filename, except that certain "wildcard characters" are interpreted in a special way. The following characters are special:
Matches one character.
Matches any number of characters up to the end of the filename, the next dot, or the next slash.
Two adjacent
Matches any of the characters listed. Two characters
separated by a hyphen will match a range of characters.
Example:
Alternation. Matches one of the alternatives.
Other characters represent themselves. Only filenames that have exactly the same character in the same position will match. (Matching is case-sensitive; i.e. "a" will not match "A").
Note that multiple "*" characters are allowed (as in Unix wildcards, but opposed to Windows/DOS wildcards).
Examples:
The following examples assume that the current directory is the top of an Erlang/OTP installation.
To find all
filelib:wildcard("lib/*/ebin/*.beam").
To find either
filelib:wildcard("lib/*/src/*.?rl")
or the following line
filelib:wildcard("lib/*/src/*.{erl,hrl}")
can be used.
To find all
filelib:wildcard("lib/*/{src,include}/*.hrl").
To find all
filelib:wildcard("lib/*/{src,include}/*.{erl,hrl}")
To find all
filelib:wildcard("lib/**/*.{erl,hrl}")
The