Next Prev Up Top Contents Index

directory

Function
Summary

Determines which files on the system have named matching a given pathname.

Package

common-lisp

Signature

directory pathname &key test directories check-for-subs => pathnames

Arguments

pathname

A pathname, string, or file-stream.

test

Filtering test (only pathnames matching the test are collected).

directories

If non- nil then directories are included in the collection.

check-for-subs

If non- nil (the default), then pathnames representing directories have null name components.

Values

pathnames

A list of physical pathnames.

Description

directory collects all the pathnames matching the given pathname.

Because truenames are now returned, the entries . and .. no longer show up in the output of directory . This means, for instance, that

(directory #P"/usr/users/")

does not include #P"/usr" , which is the truename of #P"/usr/users/.."

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 , should bar show up in the directory listing? A keyword argument has been added which lets you control this behavior.

Example
CL-USER 15 > (pprint (directory "."))
 (#P"C:/Program Files/Xanalys/LispWorks/lib/"
 #P"C:/Program Files/Xanalys/LispWorks/lispworks-  4200.exe"
 #P"C:/Program Files/Xanalys/LispWorks/readme.txt"
 #P"C:/Program Files/Xanalys/LispWorks/DeIsL1.isu"
 #P"C:/Program Files/Xanalys/LispWorks/MSVCRT.DLL")

LispWorks Reference Manual (Windows version) - 14 Dec 2001

Next Prev Up Top Contents Index