/[guile]/guile/guile-core/ice-9/boot-9.scm
ViewVC logotype

Diff of /guile/guile-core/ice-9/boot-9.scm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.319 by mvo, Fri Sep 12 15:16:42 2003 UTC revision 1.320 by kryde, Fri Sep 12 23:35:54 2003 UTC
# Line 407  Line 407 
407  (if (provided? 'socket)  (if (provided? 'socket)
408      (primitive-load-path "ice-9/networking.scm"))      (primitive-load-path "ice-9/networking.scm"))
409    
410    ;; ENHANCE-ME: Catching an exception from stat is a bit wasteful, do this in
411    ;; C where all that's needed is to inspect the return from stat().
412  (define file-exists?  (define file-exists?
413    (if (provided? 'posix)    (if (provided? 'posix)
414        (lambda (str)        (lambda (str)
415          (access? str F_OK))          (->bool (false-if-exception (stat str))))
416        (lambda (str)        (lambda (str)
417          (let ((port (catch 'system-error (lambda () (open-file str OPEN_READ))          (let ((port (catch 'system-error (lambda () (open-file str OPEN_READ))
418                             (lambda args #f))))                             (lambda args #f))))

Legend:
Removed from v.1.319  
changed lines
  Added in v.1.320

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26