From b1b4001db08c9a0b094523df18d287336651eeef Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 10 Jul 2021 19:02:50 -0700 Subject: factor out MOUNTPOINTP Signed-off-by: Sean Whitton --- src/connection.lisp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/connection.lisp') diff --git a/src/connection.lisp b/src/connection.lisp index 3105bc6..57b48c6 100644 --- a/src/connection.lisp +++ b/src/connection.lisp @@ -444,6 +444,13 @@ expected." (defun test (&rest args) (zerop (apply #'mrun :for-exit "test" args))) +(defun mountpointp (path) + "Is PATH a mount point? + +Uses mountpoint(1) from util-linux, so add a property requiring OS:LINUX or a +subclass to the :HOSTATTRS subroutine of properties calling this." + (zerop (mrun :for-exit "mountpoint" "-q" path))) + (defun delete-remote-trees (&rest paths) "Recursively delete each of PATHS." (mrun "rm" "-rf" paths)) -- cgit v1.2.3