Changeset 9048


Ignore:
Timestamp:
Apr 8, 2008, 3:12:55 AM (11 years ago)
Author:
gz
Message:

Make make-file-stream rejected wildcarded pathnames.

Various tweaks to make meta-. work when using pathnames relative to the file system's "current directory".

Location:
trunk/source/level-1
Files:
3 edited

Legend:

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

    r8932 r9048  
    152152      (signal-file-error $err-no-file path)))
    153153
     154(defun check-pathname-not-wild (path)
     155  (when (wild-pathname-p path)
     156    (error 'file-error :error-type "Inappropriate use of wild pathname ~s"
     157           :pathname path))
     158  path)
     159
    154160(defun probe-file (path)
    155161  "Return a pathname which is the truename of the file if it exists, or NIL
    156162  otherwise. An error of type FILE-ERROR is signaled if pathname is wild."
    157   (when (wild-pathname-p path)
    158     (error 'file-error :error-type "Inappropriate use of wild pathname ~s"
    159            :pathname path))
     163  (check-pathname-not-wild path)
    160164  (let* ((native (native-translated-namestring path))
    161165         (realpath (%realpath native))
     
    268272(defun absolute-directory-list (dirlist)
    269273  ; just make relative absolute and remove ups where possible
    270   (when (eq (car dirlist) :relative)
     274  (when (or (null dirlist) (eq (car dirlist) :relative))
    271275    (let ((default (mac-default-directory)) default-dir)
    272276      (when default
     
    10881092        (kind nil))
    10891093    (when full-name
     1094      (when (eq (pathname-host file-name) :unspecific) ;; if physical pathname to begin with, force absolute
     1095        (setq file-name full-name))
    10901096      (let ((file-type (pathname-type full-name)))
    10911097        (if (and file-type (neq file-type :unspecific))
  • trunk/source/level-1/l1-pathnames.lisp

    r7469 r9048  
    383383  ;; Note that %component-match-p is case sensitive.  Need a
    384384  ;; case-insensitive version for hosts.
    385   (or (string-equal path-host wild-host)
    386       (%component-match-p path-host wild-host)))
     385  ;; In addition, host components do not support wildcards.
     386  (or (eq path-host wild-host)
     387      (and (stringp path-host)
     388           (stringp wild-host)
     389           (string-equal path-host wild-host))))
    387390
    388391(defun pathname-match-p (pathname wildname)
  • trunk/source/level-1/l1-sysio.lisp

    r8699 r9048  
    755755        ((:io :output) nil)
    756756        (t (report-bad-arg direction '(member :input :output :io :probe))))
     757      (check-pathname-not-wild filename) ;; probe-file-x misses wild versions....
    757758      (multiple-value-bind (native-truename kind)(probe-file-x filename)
    758759        (if native-truename
Note: See TracChangeset for help on using the changeset viewer.