|
|
|
|
31
|
(constantly t))))))
|
31
|
(constantly t))))))
|
32
|
|
32
|
|
33
|
(define-condition directory-does-not-exist (error)
|
33
|
(define-condition directory-does-not-exist (error)
|
34
|
- ((directory :initarg dir :reader dir))
|
|
|
|
|
34
|
+ ((directory :initarg :dir :reader dir))
|
35
|
(:report (lambda (c stream)
|
35
|
(:report (lambda (c stream)
|
36
|
(format stream "The directory '~A' does not exist" (dir c)))))
|
36
|
(format stream "The directory '~A' does not exist" (dir c)))))
|
37
|
|
37
|
|
38
|
(defun (setf getcwd) (path)
|
38
|
(defun (setf getcwd) (path)
|
39
|
"Change the operating system's current directory to PATH."
|
39
|
"Change the operating system's current directory to PATH."
|
40
|
(setf path (ensure-directory-pathname path))
|
40
|
(setf path (ensure-directory-pathname path))
|
41
|
- (or (and (directory-exists-p path)
|
|
|
42
|
- (chdir path))
|
|
|
43
|
- (error 'directory-does-not-exist :dir path))
|
|
|
|
|
41
|
+ (unless (and (directory-exists-p path)
|
|
|
42
|
+ (chdir path))
|
|
|
43
|
+ (error 'directory-does-not-exist :dir path))
|
44
|
path)
|
44
|
path)
|
45
|
|
45
|
|
46
|
(defmacro with-current-directory (path &body body)
|
46
|
(defmacro with-current-directory (path &body body)
|