recursive search done

This commit is contained in:
David Botton 2024-07-04 23:22:45 -04:00
parent 81753f5b1b
commit 03f1d74e89
2 changed files with 6 additions and 5 deletions

View file

@ -2,7 +2,7 @@
;; Local file utilities
(defun read-file (infile &key clog-obj if-does-not-exist)
(defun read-file (infile &key clog-obj (report-errors t) if-does-not-exist)
"Read local file named INFILE"
(handler-case
(with-open-file (instream infile :direction :input :if-does-not-exist if-does-not-exist)
@ -12,9 +12,10 @@
(pos (read-sequence string instream)))
(subseq string 0 pos))))
(error (condition)
(if clog-obj
(alert-toast clog-obj "File Error" (format nil "Error: ~A" condition))
(format t "Error: ~A" condition))
(when report-errors
(if clog-obj
(alert-toast clog-obj "File Error" (format nil "Error: ~A" condition))
(format t "Error: ~A" condition)))
nil)))
(defun write-file (string outfile &key clog-obj (action-if-exists :rename))

View file

@ -24,7 +24,7 @@
(labels ((do-search (dir prefix)
(dolist (item (uiop:directory-files dir))
(let* ((fname (format nil "~A" item))
(c (read-file fname)))
(c (read-file fname :report-errors nil)))
(when (and c
(ppcre:scan s c))
(let ((li (create-option (result-box panel)