1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
3 ;;; --- Error conditions.
6 (in-package :io.zeta-streams
)
8 (define-condition posix-file-error
(file-error)
9 ((action :initarg
:action
:reader action-of
)
10 (code :initarg
:code
:reader code-of
)
11 (identifier :initarg
:identifier
:reader identifier-of
))
12 (:report
(lambda (condition stream
)
13 (format stream
"Error while ~A ~S: ~A"
15 (file-error-pathname condition
)
16 (%sys-strerror
(code-of condition
))))))
18 (defun posix-file-error (posix-error filename action
)
19 (error 'posix-file-error
20 :code
(code-of posix-error
)
21 :identifier
(identifier-of posix-error
)
22 :pathname filename
:action action
))