From 6bbc22725d3bf663726ed9adca544e39316364a6 Mon Sep 17 00:00:00 2001 From: Richard M Kreuter Date: Wed, 27 Feb 2008 18:56:47 +0000 Subject: [PATCH] 1.0.15.3: Have PROBE-FILE return NIL whenever a truename can't be found. See the mailing list discussions during February 2008 for details. --- NEWS | 2 ++ src/code/filesys.lisp | 32 ++++++++++++-------------------- version.lisp-expr | 2 +- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/NEWS b/NEWS index cbff7b1e6..f588a4b4c 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,7 @@ ;;;; -*- coding: utf-8; -*- changes in sbcl-1.0.16 relative to 1.0.15: + * minor incompatible change: change PROBE-FILE back to returning + NIL whenever we can't get a truename, as was the case before 1.0.14. * enhancement: add support for fcntl's struct flock to SB-POSIX. changes in sbcl-1.0.15 relative to sbcl-1.0.14: diff --git a/src/code/filesys.lisp b/src/code/filesys.lisp index 9ac3ae318..c831ec575 100644 --- a/src/code/filesys.lisp +++ b/src/code/filesys.lisp @@ -504,7 +504,7 @@ ;;; As realpath(3) is not atomic anyway, we only ever call it when ;;; we think a file exists, so just be careful when rewriting this ;;; routine. -(defun query-file-system (pathspec query-for enoent-errorp) +(defun query-file-system (pathspec query-for) (let ((pathname (translate-logical-pathname (merge-pathnames (pathname pathspec) @@ -603,25 +603,17 @@ pathname)) (:author (sb!unix:uid-username uid)) (:write-date (+ unix-to-universal-time mtime)))))) - ;; If we're still here, the file doesn't exist; return - ;; NIL or error. - (if (and (= errno sb!unix:enoent) (not enoent-errorp)) - nil - (simple-file-perror - (format nil "failed to find the ~A of ~~A" query-for) - pathspec errno)))))))) + ;; If we're still here, the file doesn't exist; error. + (simple-file-perror + (format nil "failed to find the ~A of ~~A" query-for) + pathspec errno))))))) (defun probe-file (pathspec) #!+sb-doc - "Return the truename of PATHSPEC if such a file exists, the -coercion of PATHSPEC to a pathname if PATHSPEC names a symlink -that links to itself or to a file that doesn't exist, or NIL if -errno is set to ENOENT after trying to stat(2) the file. An -error of type FILE-ERROR is signaled if PATHSPEC is a wild -pathname, or for any other circumstance where stat(2) fails." - (query-file-system pathspec :truename nil)) - + "Return the truename of PATHSPEC if the truename can be found, +or NIL otherwise. See TRUENAME for more information." + (handler-case (truename pathspec) (file-error () nil))) (defun truename (pathspec) #!+sb-doc @@ -641,22 +633,22 @@ broken symlink itself." ;; Note that eventually this routine might be different for streams ;; than for other pathname designators. (if (streamp pathspec) - (query-file-system pathspec :truename t) - (query-file-system pathspec :truename t))) + (query-file-system pathspec :truename) + (query-file-system pathspec :truename))) (defun file-author (pathspec) #!+sb-doc "Return the author of the file specified by PATHSPEC. Signal an error of type FILE-ERROR if no such file exists, or if PATHSPEC is a wild pathname." - (query-file-system pathspec :author t)) + (query-file-system pathspec :author)) (defun file-write-date (pathspec) #!+sb-doc "Return the write date of the file specified by PATHSPEC. An error of type FILE-ERROR is signaled if no such file exists, or if PATHSPEC is a wild pathname." - (query-file-system pathspec :write-date t)) + (query-file-system pathspec :write-date)) ;;;; miscellaneous other operations diff --git a/version.lisp-expr b/version.lisp-expr index e6246d13b..ae95e65fb 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.15.2" +"1.0.15.3" -- 2.11.4.GIT