Today I experimented with how to handle Racket’s directory-exists? exception thrown when the empty string is passed:
(define (isdir? dir)
(cond
[(with-handlers ([exn:fail:filesystem?
(λ (x) #f)]
[exn:fail?
(λ (x) #f)]
)
(directory-exists? dir))]
[1]))
(isdir? “”)