Oberon || Library || Module Index || Search Engine || Definition || Module
PROCEDURE Match(filename, pattern: ARRAY OF CHAR) : BOOLEAN; PROCEDURE Open(VAR s: Streams.Stream; pattern: ARRAY OF CHAR);
? matches any character * matches any (possibly empty) sequence [...] matches any character inside [] [!...] matches any character but those inside [] [a-z] matches letters 'a' to 'z' \x matches x x matches xNote that "*" does not match directory slashes ("/") and "." at the beginning of a path component.
Match returns TRUE if filename matches pattern.
Open returns a stream with the list of filenames matched by pattern. The filenames are in alphabetically order and 0X-terminated. Initially, 0X is the line terminator in the sense of StreamDisciplines. Directories without read and execute permission are not examined.
PROCEDURE ListSources; VAR s: Streams.Stream; ch: CHAR; BEGIN ScanDir.Open(s, "*.o[dm]"); WHILE Streams.ReadByte(s, ch) DO IF ch = 0X THEN Write.Ln; ELSE Write.Char(ch); END; END; Streams.Release(s); END ListSources;
sh(1) Bourne shell: shell patterns RelatedEvents handling of error events StreamDisciplines definition of line terminator Streams stream operations Texts in-memory streams
Oberon || Library || Module Index || Search Engine || Definition || Module