Skip to content

Instantly share code, notes, and snippets.

@jsmpereira
Created September 21, 2012 19:28
Show Gist options
  • Save jsmpereira/3763404 to your computer and use it in GitHub Desktop.
Save jsmpereira/3763404 to your computer and use it in GitHub Desktop.
cl-inotify
(defun pickaxe (directory)
(inotify:with-inotify (inot `((,directory ,(logior inotify:in-create
inotify:in-moved-to))))
(write-line "Waiting for sales...")
(loop
(dolist (event (inotify:read-events inot))
(when (equal
(pathname-type (inotify:event-full-name event))
"xml")
(if (string-equal directory "/path/to/dropbox/")
(process-document (inotify:event-full-name event))
(process-sale (inotify:event-full-name event))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment