diff options
Diffstat (limited to 'src/util.lisp')
-rw-r--r-- | src/util.lisp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/util.lisp b/src/util.lisp index 7fc2997..24ec85e 100644 --- a/src/util.lisp +++ b/src/util.lisp @@ -169,6 +169,14 @@ one solution is to convert your property to a :LISP property." (enough-pathname pathname (pathname-directory-pathname pathname)) pathname)))) +(defun directory-contents (pathname) + "Return the immediate contents of PATHNAME, a directory, without resolving +symlinks. Not suitable for use by :POSIX properties." + ;; On SBCL on Debian UIOP:*WILD-FILE-FOR-DIRECTORY* is #P"*.*". + (uiop:directory* + (merge-pathnames uiop:*wild-file-for-directory* + (ensure-directory-pathname pathname)))) + (defun ensure-trailing-slash (namestring) (if (string-suffix-p namestring "/") namestring @@ -297,6 +305,18 @@ expansion as a starting point for your own DEFPACKAGE form for your consfig." else do (princ #\: s) (loop-finish))))))))) +(defun system (&rest args) + "Simple wrapper around system(3)." + (foreign-funcall + "system" :string (if (cdr args) + (escape-sh-command + (loop for arg in args + if (pathnamep arg) + collect (unix-namestring arg) + else collect arg)) + (car args)) + :int)) + ;;;; Progress & debug printing |