From e4e92cf0af97120401199a77e87ff1f8c9626be6 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Fri, 12 Sep 2003 23:49:08 +0000 Subject: [PATCH] (file-exists?): Use stat rather than access?, so as to follow the effective UID/GID not the real ID. file-exists? is normally be used as a prelude to opening or some other operation, and it's the effective ID which will apply there. Emacs file-exists-p uses stat, presumably for the the same reason. --- ice-9/boot-9.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index 0227f2d83..005edb929 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -459,7 +459,7 @@ (define file-exists? (if (provided? 'posix) (lambda (str) - (access? str F_OK)) + (->bool (false-if-exception (stat str)))) (lambda (str) (let ((port (catch 'system-error (lambda () (open-file str OPEN_READ)) (lambda args #f))))