Next: Files and Symbolic Links, Previous: Environment, Up: Osicat
current-directory
returns the operating system's current directory, which may or may not correspond to*default-pathname-defaults*
.
setf
current-directory
changes the operating system's current directory to thepathspec
. An error is signalled if thepathspec
is wild or does not designate a directory.
Recursively deletes all files and directories within the directory designated by the non-wild pathname designator
dirname
includingdirname
itself.if-does-not-exist
must be one of:error
or:ignore
where:error
means that an error will be signaled if the directorydirname
does not exist.
Deletes the directory designated by
pathspec
. Returnst
. The directory must be empty. Symbolic links are not followed.Signals an error if
pathspec
is wild, doesn't designate a directory, or if the directory could not be deleted.
Checks whether the file named by the pathname designator
pathspec
exists and is a directory. Returns its truename if this is the case,nil
otherwise. Follows symbolic links.
Returns a fresh list of pathnames corresponding to all files within the directory named by the non-wild pathname designator
pathspec
. Ifbare-pathnames
is non-NIL only the files's bare pathnames are returned (with an empty directory component), otherwise the files' pathnames are merged withpathspec
.
Applies function to each entry in directory designated by
pathspec
in turn and returns a list of the results. Binds*default-pathname-defaults*
to the directory designated by pathspec round to function call.If
pathspec
designates a symbolic link, it is implicitly resolved.Signals an error if
pathspec
is wild or doesn't designate a directory.
Recursively applies the function
fn
to all files within the directory named by the non-wild pathname designatordirname
and all of its sub-directories. Returnst
on success.
fn
will only be applied to files for which the functiontest
returns a true value. Ifdirectories
is notnil
,fn
andtest
are applied to directories as well. Ifdirectories
is:depth-first
,fn
will be applied to the directory's contents first. Ifdirectories
is:breadth-first
andtest
returnsnil
, the directory's content will be skipped.if-does-not-exist
must be one of:error
or:ignore
where:error
means that an error will be signaled if the directorydirname
does not exist.
pathspec
must be a valid directory designator:*default-pathname-defaults*
is bound, and (CURRENT-DIRECTORY) is set to the designated directory for the dynamic scope of the body.Within the lexical scope of the body,
iterator
is defined via macrolet such that successive invocations of (ITERATOR) return the directory entries, one by one. Both files and directories are returned, except '.' and '..'. The order of entries is not guaranteed. The entries are returned as relative pathnames against the designated directory. Entries that are symbolic links are not resolved, but links that point to directories are interpreted as directory designators. Once all entries have been returned, further invocations of (ITERATOR) will all returnnil
.The value returned is the value of the last form evaluated in body. Signals an error if
pathspec
is wild or does not designate a directory.