1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-18 17:50:29 +02:00

(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.
This commit is contained in:
Kevin Ryde 2003-09-12 23:49:08 +00:00
parent e721987c47
commit e4e92cf0af

View file

@ -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))))