summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils.lisp7
1 files changed, 5 insertions, 2 deletions
diff --git a/utils.lisp b/utils.lisp
index e61f0f5..9ce14b1 100644
--- a/utils.lisp
+++ b/utils.lisp
@@ -181,7 +181,8 @@ ELEMENT-TYPE as the stream's."
"CACHE-~A"
cache-id))
*cache-dir*)))
- (if (and (file-exists-p cache-file)
+ (if (and (directory-exists-p *cache-dir*)
+ (file-exists-p cache-file)
#-clisp nil
#+clisp (or (not younger-p)
(> (posix:file-stat-mtime (posix:file-stat cache-file))
@@ -191,7 +192,9 @@ ELEMENT-TYPE as the stream's."
:external-format #+clisp charset:utf-8
#+sbcl :utf-8)
(read-to-array in))
- (with-open-file (out cache-file
+ (with-open-file (out (if (directory-exists-p *cache-dir*)
+ cache-file
+ #p"/dev/null")
:direction :output
:if-exists :supersede
:external-format #+clisp charset:utf-8