Charles.Forsyth20060303-partialeea662d19 years agoHistory
80 lines · 1.2 KB · Text
RawDownload
.TH FILEPAT 2.SH NAMEfilepat: expand, match \- file pattern matching.SH SYNOPSIS.EXinclude "filepat.m";filepat := load Filepat Filepat->PATH; expand:  fn(pat: string): list of string;match:   fn(pat, name: string): int;.EE.SH DESCRIPTION.B Expandbuilds a list of file names in alphabetical order that matchthe pattern.IR pat .The pattern is tokenised using.B /as a delimiter..PP.B Matchreturns 1 if.I namematches the pattern.IR pat ,and 0 otherwise..PPThe.I patpassed to.B matchand.B expandmay include combinations of the special characters.BR * ,.BR ? ,.BR [ ,and.BR ] ..PPThe asterisk.B *matches a string of zero or more characters..PPThe query.B ?matches any single character..PPThe notation.BI [ s ]\f1,where.I sis a nonempty string, matches anysingle character in.IR s .The notation.BI [^ s ]\f1,where.IR sis a nonempty string, matches anysingle character not in.IR s .The characters.BR * ,.BR ? ,and.BR [have no special meaning within s..PPIf any characteris preceded by the character.BR \e ,that character loses any special meaningand is interpreted literally..SH SOURCE.B /appl/lib/filepat.b.SH SEE ALSO.IR sys-tokenize (2),.IR readdir (2).IR regex (2)