1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

slight tweak to file-exists?, file-is-directory?

* module/ice-9/boot-9.scm (file-exists?, file-is-directory?): For the
  fallback cases, use open-input-file instead of open-file with
  OPEN_READ.
This commit is contained in:
Andy Wingo 2012-03-06 00:36:25 +01:00
parent f7955da966
commit d867c7496c

View file

@ -1446,7 +1446,7 @@ VALUE."
(lambda (str)
(->bool (stat str #f)))
(lambda (str)
(let ((port (catch 'system-error (lambda () (open-file str OPEN_READ))
(let ((port (catch 'system-error (lambda () (open-input-file str))
(lambda args #f))))
(if port (begin (close-port port) #t)
#f)))))
@ -1457,8 +1457,8 @@ VALUE."
(eq? (stat:type (stat str)) 'directory))
(lambda (str)
(let ((port (catch 'system-error
(lambda () (open-file (string-append str "/.")
OPEN_READ))
(lambda ()
(open-input-file (string-append str "/.")))
(lambda args #f))))
(if port (begin (close-port port) #t)
#f)))))