From 1e6ee3f5671c8c376e4a721450791719d5ceb3fa Mon Sep 17 00:00:00 2001 From: Olof-Joachim Frahm Date: Sat, 9 Feb 2013 15:39:40 +0100 Subject: [PATCH] Cleanup, make one function conditional. --- cl-inotify.asd | 4 ++-- inotify.lisp | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cl-inotify.asd b/cl-inotify.asd index e99c80f..1f9e6e9 100644 --- a/cl-inotify.asd +++ b/cl-inotify.asd @@ -42,5 +42,5 @@ #:osicat) :serial T :components ((:file "package") - (cffi-grovel:grovel-file "grovel") - (:file "inotify"))) + (cffi-grovel:grovel-file "grovel") + (:file "inotify"))) diff --git a/inotify.lisp b/inotify.lisp index 16c3099..efcc860 100644 --- a/inotify.lisp +++ b/inotify.lisp @@ -374,7 +374,9 @@ error." (defmacro do-events ((var inotify &key blocking-p) &body body) "Loops BODY with VAR bound to the next events retrieved from INOTIFY. The macro uses NEXT-EVENT, so reading an event won't block and the loop -terminates if no events are available." +terminates if no events are available. If BLOCKING-P is set, the loop +blocks if no events are available, otherwise it exits as soon as no +events were encountered." (check-type var symbol) (let ((inotify-sym (gensym))) `(loop @@ -396,7 +398,7 @@ terminates if no events are available." (defmacro with-unregistered-inotify ((inotify &optional (nonblocking T) &rest rest) &body body) "Like WITH-INOTIFY, but uses MAKE-UNREGISTERED-INOTIFY and WATCH-RAW instead. Useful if you need to monitor just a fixed set of paths." - `(let* ((,inotify (make-unregistered-inotify ,nonblocking))) + `(let ((,inotify (make-unregistered-inotify ,nonblocking))) (unwind-protect (progn ,.(mapcar (lambda (specifier) @@ -414,7 +416,7 @@ more forms (PATHNAME FLAGS &KEY (REPLACE-P T)). Since the QUEUE is closed on unwinding, this macro doesn't bother with UNWATCH calls on all WATCHed paths." - `(let* ((,inotify (make-inotify ,nonblocking))) + `(let ((,inotify (make-inotify ,nonblocking))) (unwind-protect (progn ,.(mapcar (lambda (specifier) @@ -446,6 +448,7 @@ value of REGISTERED (default T)." (funcall ,event-handler ,inotify))) ,@body)))) +#+sbcl (defun run-inotify-program (program args rest directories flags &key function (wait T) event-handler (registered T)) "Runs a program and records all matched events in all DIRECTORIES using -- 1.7.10.4