Port ZETA-STREAMS to IOLIB.SYSCALLS.
[iolib/alendvai.git] / io.streams / zeta / conditions.lisp
blob8ca111a807e69be8dd0e086b724c55476b3f56e4
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; --- Error conditions.
4 ;;;
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"
14 (action-of condition)
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))