cl-rw

Layered streams for Common Lisp
git clone https://logand.com/git/cl-rw.git/
Log | Files | Refs

commit 41799a908a82e6ee3bdf20b4bb65c86d876fe607
parent 9a894fbe1c966dbd6a613bbad720b98fe334cb13
Author: Tomas Hlavaty <tom@logand.com>
Date:   Sun, 27 Oct 2013 20:53:05 +0100

fix store-reference

Diffstat:
Mcas.lisp | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/cas.lisp b/cas.lisp @@ -147,13 +147,14 @@ (defun store-reference (kind key oid how) (let ((f (reference-pathname kind key))) - (multiple-value-bind (yes no) (ecase how - (:create (values :create :error)) - (:update (values :error :supersede))) + (ensure-directories-exist f) + (multiple-value-bind (n y) (ecase how + (:create (values :create :error)) + (:update (values :error :supersede))) (with-open-file (s f :direction :output - :if-does-not-exist no - :if-exists yes) + :if-does-not-exist n + :if-exists y) (write oid :stream s))))) (defun make-reference (kind key oid)