Skip to content
Browse files

Replace cl-fad by UIOP.

  • Loading branch information
fukamachi committed Aug 26, 2015
1 parent d73474b commit 6fba1ee547058c6c6845a02ecdefacfd50eaf6b2
Showing with 18 additions and 10 deletions.
  1. +1 −1 clack-v1-compat.asd
  2. +14 −6 v1-compat/src/core/app/directory.lisp
  3. +3 −3 v1-compat/src/core/app/file.lisp
@@ -15,7 +15,7 @@
@@ -6,11 +6,11 @@
(:import-from :cl-fad
(:import-from :uiop
(:import-from :local-time
@@ -33,11 +33,19 @@
:port port))

(defmethod should-handle ((this <clack-app-directory>) file)
(file-exists-p file))
(uiop:file-exists-p file))

(defun list-directory (dir)
(sort (nconc (uiop:subdirectories dir) (uiop:directory-files dir))
:key (lambda (path)
(if (uiop:directory-pathname-p path)
(car (last (pathname-directory path)))
(file-namestring path)))))

(defmethod serve-path ((this <clack-app-directory>) env file encoding)
(declare (ignore encoding))
(if (directory-pathname-p file)
(if (uiop:directory-pathname-p file)
`(200 nil (,(dir-page
(getf env :path-info)
(format nil "~A~{~A~}"
@@ -63,7 +71,7 @@

(defun dir-file (file &key uri name)
"Stolen from rack/directory.rb."
(let* ((dir-p (directory-pathname-p file))
(let* ((dir-p (uiop:directory-pathname-p file))
(uri (or uri
(if dir-p
(car (last (pathname-directory file)))
@@ -9,7 +9,7 @@
(:import-from :local-time
(:import-from :cl-fad
(:import-from :uiop
(:import-from :alexandria
@@ -66,8 +66,8 @@
;; Ignore simple-file-error in a case that
;; the file path contains some special characters like "?".
;; See
(file-exists-p file))
(not (directory-exists-p file)))))
(uiop:file-exists-p file))
(not (uiop:directory-exists-p file)))))

(defgeneric locate-file (app path root)

0 comments on commit 6fba1ee

Please sign in to comment.
You can’t perform that action at this time.