summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2007-06-30 21:40:51 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2007-06-30 21:40:51 +0200
commit967c3b8d2b7558a1390dab8715630c4d697bcaae (patch)
tree1f535779d45c8b149f02e7dcab90ca8e2d84974a
parentf262befd1591052f273055a3b1e80aa0d62e3814 (diff)
Make CALL-WITH-RESULT-CACHE not break in the absence of a cache directory.
darcs-hash:ffd46f4c8b0a630a886be8893d3b909bae473ce0
-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