mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 10:40:45 -08:00
recursive search done
This commit is contained in:
parent
81753f5b1b
commit
03f1d74e89
2 changed files with 6 additions and 5 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
;; Local file utilities
|
;; 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"
|
"Read local file named INFILE"
|
||||||
(handler-case
|
(handler-case
|
||||||
(with-open-file (instream infile :direction :input :if-does-not-exist if-does-not-exist)
|
(with-open-file (instream infile :direction :input :if-does-not-exist if-does-not-exist)
|
||||||
|
|
@ -12,9 +12,10 @@
|
||||||
(pos (read-sequence string instream)))
|
(pos (read-sequence string instream)))
|
||||||
(subseq string 0 pos))))
|
(subseq string 0 pos))))
|
||||||
(error (condition)
|
(error (condition)
|
||||||
(if clog-obj
|
(when report-errors
|
||||||
(alert-toast clog-obj "File Error" (format nil "Error: ~A" condition))
|
(if clog-obj
|
||||||
(format t "Error: ~A" condition))
|
(alert-toast clog-obj "File Error" (format nil "Error: ~A" condition))
|
||||||
|
(format t "Error: ~A" condition)))
|
||||||
nil)))
|
nil)))
|
||||||
|
|
||||||
(defun write-file (string outfile &key clog-obj (action-if-exists :rename))
|
(defun write-file (string outfile &key clog-obj (action-if-exists :rename))
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
(labels ((do-search (dir prefix)
|
(labels ((do-search (dir prefix)
|
||||||
(dolist (item (uiop:directory-files dir))
|
(dolist (item (uiop:directory-files dir))
|
||||||
(let* ((fname (format nil "~A" item))
|
(let* ((fname (format nil "~A" item))
|
||||||
(c (read-file fname)))
|
(c (read-file fname :report-errors nil)))
|
||||||
(when (and c
|
(when (and c
|
||||||
(ppcre:scan s c))
|
(ppcre:scan s c))
|
||||||
(let ((li (create-option (result-box panel)
|
(let ((li (create-option (result-box panel)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue