EXT:PROBE-DIRECTORY
(
tests whether EXT:PROBE-DIRECTORY
pathname
)pathname
exists
and is a directory.
It will, unlike PROBE-FILE
or TRUENAME
, not SIGNAL
an ERROR
if the parent directory of pathname
does not exist.
DIRECTORY
(
can run in two modes:
DIRECTORY
&OPTIONAL
pathname
&KEY
:FULL :CIRCLE :IF-DOES-NOT-EXIST
)
pathname
contains no name or type component, a
list of all matching directories is produced.
E.g., (DIRECTORY
"/etc/*/")
lists
all subdirectories in the directory
#P"/etc/"
.(DIRECTORY
"/etc/*")
lists all
regular files in the directory #P"/etc/"
.
If you want all the files and subdirectories in the current directory,
you should use (
.
If you want all the files and subdirectories in all the subdirectories
under the current directory (similar to the ls
NCONC
(DIRECTORY
"*/") (DIRECTORY
"*"))-R
UNIX command), use
(
.NCONC
(DIRECTORY
"**/") (DIRECTORY
"**/*"))
Keyword arguments accepted by DIRECTORY
:FULL
NIL
, additional
information is returned: for each matching file you get a LIST
of
at least four elements (file-pathname
file-truename
file-write-date-as-decoded-time
file-length
).
:CIRCLE
NIL
, DIRECTORY
avoids
endless loops that may result from symbolic links.
:IF-DOES-NOT-EXIST
This argument controls the treatment of links pointing to non-existent files and can take the following values:
:DISCARD
(default):ERROR
ERROR
is SIGNAL
ed on bad directory entries
(this corresponds to the default behavior of DIRECTORY
in CMU CL)
:KEEP
(DIRECTORY
... :TRUNAMEP
NIL
)
call in CMU CL)
:IGNORE
:DISCARD
, but also do
not SIGNAL
an ERROR
when a directory is unaccessible (contrary
to the [ANSI CL standard] specification).(
is like EXT:DIR
&OPTIONAL
pathname
)DIRECTORY
, but displays the pathnames
instead of returning them. (EXT:DIR)
shows the contents of the current directory.
EXT:DEFAULT-DIRECTORY
(
is equivalent to EXT:DEFAULT-DIRECTORY
)(
.
EXT:CD
)(
is equivalent to
SETF
(EXT:DEFAULT-DIRECTORY
) pathname
)(
, except for the return value.EXT:CD
pathname
)
EXT:DELETE-DIRECTORY
(
removes an (empty) subdirectory.EXT:DELETE-DIRECTORY
directory
)
EXT:RENAME-DIRECTORY
(
renames a
subdirectory to a new name.EXT:RENAME-DIRECTORY
old-directory
new-directory
)
These notes document CLISP version 2.49.93+ | Last modified: 2018-02-19 |