X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/lisp/blobdiff_plain/ad8995ca2397db9b5d9e1d3357d5e1a6730fdfe4..2d8bac2c972c9fc294f48df7b6afc34fab744608:/safely.lisp?ds=sidebyside diff --git a/safely.lisp b/safely.lisp index f62420c..c78492a 100644 --- a/safely.lisp +++ b/safely.lisp @@ -67,14 +67,16 @@ (defun safely-open-output-stream (safe file &rest open-args) (defun delete-file-without-moaning (file) "Delete the FILE, ignoring errors." - (when (probe-file file) - (sys-unlink file))) + (with-errno-handlers () + (sys-unlink file) + (ENOENT nil))) (defun rename-file-without-moaning (old new) "Rename OLD to NEW, ignoring errors, and without doing any stupid name mangling." - (when (probe-file old) - (sys-rename old new))) + (with-errno-handlers () + (sys-rename old new) + (ENOENT nil))) (defun safely-unwind (trail) "Roll back the TRAIL of operations."