From: Stelian Ionescu Date: Wed, 16 Jan 2013 20:27:19 +0000 (+0100) Subject: DELETE-FILES: avoid following symlinks by default, add a keyword argument to enable it X-Git-Tag: v0.8.0~23 X-Git-Url: https://repo.or.cz/w/iolib.git/commitdiff_plain/5b2a85113ed7d7445ba96f5d5cecb3f9bfae2aa3 DELETE-FILES: avoid following symlinks by default, add a keyword argument to enable it --- diff --git a/src/os/os-unix.lisp b/src/os/os-unix.lisp index 27f88c7..912cacb 100644 --- a/src/os/os-unix.lisp +++ b/src/os/os-unix.lisp @@ -533,7 +533,7 @@ the files and directories contained within. Returns T on success." (walk directory 0 nil) t))) -(defun delete-files (pathspec &key recursive) +(defun delete-files (pathspec &key recursive follow-symlinks) (labels ((%delete-file (file) (isys:unlink (file-path-namestring (absolute-file-path file)))) @@ -541,7 +541,7 @@ the files and directories contained within. Returns T on success." (isys:rmdir (file-path-namestring (absolute-file-path directory))))) (let* ((pathspec (file-path pathspec)) - (kind (file-kind pathspec :follow-symlinks t))) + (kind (file-kind pathspec :follow-symlinks follow-symlinks))) (case kind (:directory (if recursive