diff options
Diffstat (limited to 'src/connection.lisp')
-rw-r--r-- | src/connection.lisp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/connection.lisp b/src/connection.lisp index d051ad6..68a1404 100644 --- a/src/connection.lisp +++ b/src/connection.lisp @@ -542,12 +542,25 @@ subclass to the :HOSTATTRS subroutine of properties calling this." (alet (sh-escape (drop-trailing-slash (unix-namestring directory))) (mrun (format nil "rm -rf -- ~A/* ~A/.[!.]* ~A/..?*" it it it)))) +(defun remote-test-multiple (operator paths connective) + (apply #'remote-test (loop for path on paths + nconc (list operator (car path)) + when (cdr path) collect connective))) + (defun remote-exists-p (&rest paths) - "Does each of PATHS exists? + "Does each of PATHS exist? PATH may be any kind of file, including directories." - (apply #'remote-test (loop for path on paths - nconc (list "-e" (car path)) - when (cdr path) collect "-a"))) + (remote-test-multiple "-e" paths "-a")) + +(defun remote-exists-every-p (&rest paths) + "Does each of PATHS exist? +PATH may be any kind of file, including directories." + (remote-test-multiple "-e" paths "-a")) + +(defun remote-exists-some-p (&rest paths) + "Do any of PATHS exist? +PATH may be any kind of file, including directories." + (remote-test-multiple "-e" paths "-o")) (defun remote-file-stats (path) "Get the numeric mode, size in bytes, mtime, owner and group of PATH, or NIL if |