with-ignored-noent added by mario-goulart on Fri Jan 5 14:40:15 2024

(define (with-ignored-noent thunk)
  (handle-exceptions exn
    (when (and ((condition-predicate 'i/o) exn)
               ((condition-predicate 'file) exn)
               (not (= (errno) errno/noent)))
      (signal exn))
    (thunk)))


(with-ignored-noent
 (lambda ()
   (delete-file "/this/file/does/not/exist")))