diff --git a/thot.lisp b/thot.lisp
index b3b6db0..bebb42c 100644
--- a/thot.lisp
+++ b/thot.lisp
@@ -389,10 +389,12 @@ The requested url "
t)))
(defun probe-file (path)
- (let ((filep (fcntl:c-open/2 path fcntl:+o-rdonly+)))
- (unless (< filep 0)
- (unistd:close filep)
- t)))
+ (when (with-stat (stat) path
+ (s-isreg (the fixnum (stat-mode stat))))
+ (let ((filep (the fixnum (fcntl:c-open/2 path fcntl:+o-rdonly+))))
+ (unless (< filep 0)
+ (unistd:close filep)
+ t))))
(defun prefix-p (pre str)
(declare (type simple-string pre str))