Overview Module Function Class Tea 3.2.5 Reference Documentation
© 2009 PDM&FC

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
    }
}


Overview Module Function Class Tea 3.2.5 Reference Documentation
© 2009 PDM&FC
Report a bug or request new features
© 2009