(define (set-working-directory-pathname! name)
(let ((pathname (new-pathname name)))
+ ;; XXX Checking FILE-DIRECTORY? is a stop-gap kludge until we fix
+ ;; the concept of `working directory' by (a) making it be the
+ ;; directory, not the pathname; (b) making it thread-local, and (c)
+ ;; opening it in SET-WORKING-DIRECTORY! and hanging onto it for
+ ;; relative lookups, either by changing directory just before each
+ ;; lookup or using relative lookup system calls.
+ (if (not (file-directory? pathname))
+ (error:file-operation name "enter" "directory"
+ (if (file-exists?
+ (directory-pathname-as-file pathname))
+ "not a directory"
+ "no such directory")
+ 'SET-WORKING-DIRECTORY-PATHNAME!
+ (list name)))
(set! *working-directory-pathname* pathname)
(set! *default-pathname-defaults* pathname)
(cmdl/set-default-directory (nearest-cmdl) pathname)