User Tools


This shows you the differences between two versions of the page.

Link to this comparison view

cl:functions:directory [2019/09/14 05:00]
cl:functions:directory [2019/09/22 06:00] (current)
Line 1: Line 1:
 +====== Function DIRECTORY ======
 +  * **directory** //pathspec ''&​key''​ // → //​pathnames//​
 +====Arguments and Values====
 +  * //​pathspec//​ - a //​[[CL:​Glossary:​pathname designator]]//,​ which may contain //​[[CL:​Glossary:​wild]]//​ components.
 +  * //​pathnames//​ - a //​[[CL:​Glossary:​list]]//​ of //​[[CL:​Glossary:​physical pathname|physical pathnames]]//​.
 +Determines which, if any, //​[[CL:​Glossary:​file|files]]//​ that are present in the file system have names matching //​pathspec//,​ and returns a //​[[CL:​Glossary:​fresh]]//​ //​[[CL:​Glossary:​list]]//​ of //​[[CL:​Glossary:​pathname|pathnames]]//​ corresponding to the //​[[CL:​Glossary:​truename|truenames]]//​ of those //​[[CL:​Glossary:​file|files]]//​.
 +An //​[[CL:​Glossary:​implementation]]//​ may be extended to accept //​[[CL:​Glossary:​implementation-defined]]//​ keyword arguments to **directory**.
 +====Affected By====
 +The host computer'​s file system.
 +====Exceptional Situations====
 +If the attempt to obtain a directory listing is not successful, an error of type **[[CL:​Types:​file-error]]** is signaled.
 +====See Also====
 +**[[CL:​Types:​pathname|System Class PATHNAME]]**,​ **[[CL:​Types:​logical-pathname|System Class LOGICAL-PATHNAME]]**,​ **[[CL:​Functions:​ensure-directories-exist|Function ENSURE-DIRECTORIES-EXIST]]**,​ {\secref\FileSystemConcepts},​ {\secref\OpenAndClosedStreams},​
 +If the //​pathspec//​ is not //​[[CL:​Glossary:​wild]]//,​ the resulting list will contain either zero or one elements.
 +Common Lisp specifies ''&​key''​ in the argument list to **directory** even though no //​[[CL:​Glossary:​standardized]]//​ keyword arguments to **directory** are defined. '':​allow-other-keys [[CL:​Constant Variables:​t]]''​ may be used in //​[[CL:​Glossary:​conforming program|conforming programs]]//​ in order to quietly ignore any additional keywords which are passed by the program but not supported by the //​[[CL:​Glossary:​implementation]]//​.