Changeset 349


Ignore:
Timestamp:
Jan 20, 2004, 3:41:11 PM (21 years ago)
Author:
Gary Byers
Message:

Bryan O'Connor's fix to PROBE-FILE.

File:
1 edited

Legend:

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

    r314 r349  
    131131(defun probe-file (path)
    132132  (let* ((native (native-translated-namestring path))
    133         (realpath (%realpath native))
    134         (kind (if realpath (%unix-file-kind realpath))))
     133        (realpath (%realpath native))
     134        (kind (if realpath (%unix-file-kind realpath))))
    135135    ;; Darwin's #_realpath will happily return non-nil for
    136136    ;; files that don't exist.  I don't think that
    137137    ;; %UNIX-FILE-KIND would do so.
    138138    (when kind
    139       (when (and realpath
    140                  (> (length native) 0)
    141                  (eq (aref native (1- (length native))) #\/))
    142         ;; If started with a directory, return a directory (%realpath
    143         ;; always strips off the trailing /).
    144         ;; E.g. (truename "/foo/bar/") should return "/foo/bar/".
    145         (if (eq kind :directory)
    146           (unless (eq (aref realpath (1- (length realpath))) #\/)
    147             (setq realpath (%str-cat realpath "/")))
    148           (setq realpath nil)))
    149       (when realpath
    150         (native-to-pathname realpath)))))
     139      (if (eq kind :directory)
     140          (unless (eq (aref realpath (1- (length realpath))) #\/)
     141            (setq realpath (%str-cat realpath "/"))))
     142      (if realpath
     143        (native-to-pathname realpath)
     144        nil))))
    151145
    152146(defun cwd (path) 
Note: See TracChangeset for help on using the changeset viewer.