FILEPAT(2) System Calls Manual FILEPAT(2)

filepat: expand, match - file pattern matching

include "filepat.m";
filepat := load Filepat Filepat->PATH;
expand:  fn(pat: string): list of string;
match:   fn(pat, name: string): int;

Expand builds a list of file names in alphabetical order that match the pattern pat. The pattern is tokenised using / as a delimiter.

Match returns 1 if name matches the pattern pat, and 0 otherwise.

The pat passed to match and expand may include combinations of the special characters *, ?, [, and ].

The asterisk * matches a string of zero or more characters.

The query ? matches any single character.

The notation [s], where s is a nonempty string, matches any single character in s. The notation [^s], where s is a nonempty string, matches any single character not in s. The characters *, ?, and [ have no special meaning within s.

If any character is preceded by the character \, that character loses any special meaning and is interpreted literally.

/appl/lib/filepat.b

sys-tokenize (2), readdir (2) regex (2)