From 967c3b8d2b7558a1390dab8715630c4d697bcaae Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Sat, 30 Jun 2007 21:40:51 +0200 Subject: Make CALL-WITH-RESULT-CACHE not break in the absence of a cache directory. darcs-hash:ffd46f4c8b0a630a886be8893d3b909bae473ce0 --- utils.lisp | 7 +++++-- 1 file 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 -- cgit v1.2.3