Changeset 349
- Timestamp:
- Jan 20, 2004, 3:41:11 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/ccl/level-1/l1-files.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/level-1/l1-files.lisp
r314 r349 131 131 (defun probe-file (path) 132 132 (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)))) 135 135 ;; Darwin's #_realpath will happily return non-nil for 136 136 ;; files that don't exist. I don't think that 137 137 ;; %UNIX-FILE-KIND would do so. 138 138 (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)))) 151 145 152 146 (defun cwd (path)
Note:
See TracChangeset
for help on using the changeset viewer.
