A pathname, string, or file-stream.
Filtering test (only pathnames matching the test are collected).
A boolean controlling whether non-matching directories are included in the result.
nil, then symbolic links are not followed. This means that returned names are not necessarily truenames, but has the useful feature that the
pathname-directory of each pathname returned is the directory supplied as argument.
The default value of link-transparency is given by the special variable,
*directory-link-transparency*, which has initial value
t on non-Windows platforms. By setting this variable to
nil, you can get the old behavior of
directory. On Windows, where the file system does not normally support symbolic links, this variable is initially
If this is non-nil, then the pathname pointed to by a symbolic link appears in the output whether or not this file actually exists. If
:link-transparency is non-nil and
nil (this is the default on non-Windows platforms), then symbolic links to nonexistent files do not appear.
directory returns truenames, conforming to the ANSI specification for Common Lisp. Some programs may depend on the old behavior, however (and
directory is slower if it has to find the truename for every file in the directory), and so two keyword arguments are available so that the old behavior can still be used: link-transparency and non-existent-link-destinations.
The specification is unclear as to the appropriate behavior of
directory in the presence of links to non-existent files or directories. For example, if the directory contains
foo, which is a symbolic link to
bar, and there is no file named
bar show up in the directory listing? A keyword argument has been added which lets you control this behavior.
directory returns a single pathname if called with a non-wild (fully-specified) pathname. LispWorks truenames are fully-specified, so this affects recursive calls to
directories, if non-nil, causes paths of directories that are sub-directories of the directory of the argument pathname to be included in the result, even if they do not match pathname in the name, type or version components. The default value of directories is
When flat-file-namestring is non-nil,
directory matches the
file-namestring of pathname as a flat string, rather than a pathname name and pathname type. The default value of flat-file-namestring is
*cannot be handled by LispWorks. This is because LispWorks uses
*as a wildcard, so there can be confusion if a file name containing
*is created, for example in the pathnames returned by
:check-for-subs argument, implemented in LispWorks 4.0.1 and previous versions, has been removed. This argument controlled whether directories in the result have null name components. This option is no longer valid since ANSI Common Lisp specifies that
directory returns truenames.
(directory "dir/*p" :flat-file-namestring t)
LispWorks User Guide and Reference Manual - 20 Sep 2017