aboutsummaryrefslogtreecommitdiff
path: root/src/connection.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/connection.lisp')
-rw-r--r--src/connection.lisp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/connection.lisp b/src/connection.lisp
index 9159a02..782160a 100644
--- a/src/connection.lisp
+++ b/src/connection.lisp
@@ -481,6 +481,11 @@ subclass to the :HOSTATTRS subroutine of properties calling this."
"Recursively delete each of PATHS."
(mrun "rm" "-rf" paths))
+(defun empty-remote-directory (directory)
+ "Recursively delete the contents of DIRECTORY, but not DIRECTORY itself."
+ (let ((d (escape-sh-token (drop-trailing-slash (unix-namestring directory)))))
+ (mrun (format nil "rm -rf -- ~A/* ~A/.[!.]* ~A/..?*" d d d))))
+
(defun remote-exists-p (&rest paths)
"Does each of PATHS exists?
PATH may be any kind of file, including directories."