These functions return a list of strings which match the pattern given by
the null-terminated string pattern. The list and each of its
component strings are allocated with malloc(3) and are null-terminated.
Pattern may contain shell file name generation meta-characters
(see sh(1)):
- *
-
Matches any sequence of zero or more characters.
- ?
-
Matches any single character.
- [ . . . ]
-
Matches any single character which is a member of this character class.
If the first character within the brackets is !, then this
pattern matches any single character which is not a member
of this character class. The class is composed of the characters
listed within the brackets. Furthermore, if two characters are listed
separated by -, the class includes all the characters lexically
between the two, inclusively.
A / may not be matched with a meta-character; nor may a dot at
the beginning of the pattern or a dot immediately following a /.
Genfilnam searches directories for file names which match pattern.
Pattern is interpreted as a full file name specification
which may contain /’s.
If pattern does not contain meta-characters or if it does but no
match is found, pattern is returned as the only element of the list.
Dirfiles searches a single directory, dir, for files which match
pattern.
Pattern is interpreted as a specification for files within this
directory only. /’s are interpreted as ordinary characters.
These functions support files(misc).