Work around problem in NT: prompting for a directory with a wildcard
authorChris Hanson <org/chris-hanson/cph>
Sat, 23 Aug 1997 05:20:15 +0000 (05:20 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sat, 23 Aug 1997 05:20:15 +0000 (05:20 +0000)
was causing an error.  On unix, this works because FILE-DIRECTORY?
accepts such specifications as arguments -- but on NT, it doesn't.

v7/src/edwin/filcom.scm

index 4b5c3f00480414f494b578340f24855c7de1bbce..0f633a8a948e4ff55b2a4c6010d92a9367a20e15 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: filcom.scm,v 1.191 1997/07/25 07:07:24 cph Exp $
+;;;    $Id: filcom.scm,v 1.192 1997/08/23 05:20:15 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-97 Massachusetts Institute of Technology
 ;;;
@@ -688,11 +688,15 @@ Prefix arg means treat the plaintext file as binary data."
 
 (define (prompt-for-directory prompt default)
   (->namestring
-   (let ((directory
-         (prompt-for-pathname* prompt default file-directory? false)))
-     (if (file-directory? directory)
-        (pathname-as-directory directory)
-        directory))))
+   (let ((file-directory?
+         (lambda (pathname)
+           (and (not (pathname-wild? pathname))
+                (file-directory? pathname)))))
+     (let ((directory
+           (prompt-for-pathname* prompt default file-directory? false)))
+       (if (file-directory? directory)
+          (pathname-as-directory directory)
+          directory)))))
 
 (define (prompt-for-existing-directory prompt default)
   (->namestring