Function glob
glob dirName fileSpec [...]
Retrieves a list of files contained in a directory and whose names
match a regular expression.
- Parameters:
- dirName -
String representing the name of the directory where the files will
be searched for.
- fileSpec -
A regular expression
- Returns:
-
A list of strings representing the names of files contained in the
dirName and whose name matches one of the regular
expressions.
-
Note that there is no guaranty on the order of the names in the
list returned by the function.
As an example, the following function echos to the standard output
the names of the files in the current directory.
define list-current-dir () {
foreach fileName [glob "." ".*"] {
$stdout writeln $fileName
}
}
Report a bug or request new features
© 2002