Next: , Up: Filesystem Operations   [Contents][Index]


2.17.1 Wildcard Matching

Unix filesystem operations such as open will accept wildcard pathnames that match a single file (of course, directory allows any number of matches.) Filesystem operations treat :wild-inferiors the same as :wild.

Function: directory wildname &key :all :check-for-subdirs

:truenamep :follow-links

The keyword arguments to this Common Lisp function are a CMUCL extension. The arguments (all default to t) have the following functions:

:all

Include files beginning with dot such as .login, similar to “ls -a”.

:check-for-subdirs

Test whether files are directories, similar to “ls -F”.

:truenamep

Call truename on each file, which expands out all symbolic links. Note that this option can easily result in pathnames being returned which have a different directory from the one in the wildname argument.

:follow-links

Follow symbolic links when searching for matching directories.

Function: extensions:print-directory wildname &optional stream &key :all :verbose :return-list

Print a directory of wildname listing to stream (default *standard-output*.) :all and :verbose both default to nil and correspond to the “-a” and “-l” options of ls. Normally this function returns nil, but if :return-list is true, a list of the matched pathnames are returned.


Next: File Name Completion, Up: Filesystem Operations   [Contents][Index]