Changeset 437


Ignore:
Timestamp:
Jan 30, 2004, 3:51:38 PM (21 years ago)
Author:
Gary Byers
Message:

IF-EXISTS: dialog nonsense. PROBE-FILE checks WILD-PATHNAME-P, which moved
here.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-1/l1-files.lisp

    r396 r437  
    6262  (case if-exists
    6363    (:error (signal-file-error (- #$EEXIST) filename))
    64     ((:dialog :new-version :rename) (overwrite-dialog filename prompt))
     64    ((:dialog) (overwrite-dialog filename prompt))
    6565    ((nil) nil)
    66     ((:ignored :overwrite :append :supersede :rename-and-delete) filename)
     66    ((:ignored :overwrite :append :supersede :rename-and-delete :new-version :rename) filename)
    6767    (t (report-bad-arg if-exists '(member :error :dialog nil :ignored :overwrite :append :supersede :rename-and-delete)))))
    6868
     
    130130
    131131(defun probe-file (path)
     132  (when (wild-pathname-p path)
     133    (error 'file-error :error-type "Inappropriate use of wild pathname ~s"
     134           :pathname path))
    132135  (let* ((native (native-translated-namestring path))
    133136         (realpath (%realpath native))
     
    12101213            (return path))))))
    12111214
     1215(defun wild-pathname-p (pathname &optional field-key)
     1216  (flet ((wild-p (name) (or (eq name :wild)
     1217                            (eq name :wild-inferiors)
     1218                            (and (stringp name) (%path-mem "*" name)))))
     1219    (case field-key
     1220      ((nil)
     1221       (or (some #'wild-p (pathname-directory pathname))
     1222           (wild-p (pathname-name pathname))
     1223           (wild-p (pathname-type pathname))
     1224           (wild-p (pathname-version pathname))))
     1225      (:host nil)
     1226      (:device nil)
     1227      (:directory (some #'wild-p (pathname-directory pathname)))
     1228      (:name (wild-p (pathname-name pathname)))
     1229      (:type (wild-p (pathname-type pathname)))
     1230      (:version (wild-p (pathname-version pathname)))
     1231      (t (wild-pathname-p pathname
     1232                          (require-type field-key
     1233                                        '(member nil :host :device
     1234                                          :directory :name :type :version)))))))
Note: See TracChangeset for help on using the changeset viewer.