File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,26 @@ creates the directories if they do not exist:
8383
8484This may create ` foo ` , ` bar ` and ` baz ` . Don't forget the trailing slash.
8585
86+ ### Deleting directories
87+
88+ Use ` uiop:delete-directory-tree ` with a pathname (` #p ` ), a trailing slash and the ` :validate ` key:
89+
90+ ~~~ lisp
91+ ;; mkdir dirtest
92+ (uiop:delete-directory-tree #p"dirtest/" :validate t)
93+ ~~~
94+
95+ You can use ` pathname ` around a string that designates a directory:
96+
97+ ~~~ lisp
98+ (defun rmdir (path)
99+ (uiop:delete-directory-tree (pathname path) :validate t))
100+ ~~~
101+
102+ UIOP also has ` delete-empty-directory `
103+
104+ [ cl-fad] [ cl-fad ] has ` (fad:delete-directory-and-files "dirtest") ` .
105+
86106
87107### Opening a file
88108
@@ -592,3 +612,5 @@ operations.
592612~~~
593613
594614See also ` (user-homedir-pathname) ` .
615+
616+ [ cl-fad ] : https://edicl.github.io/cl-fad/
You can’t perform that action at this time.
0 commit comments