probe-directory
"Walter C. Pelissero" <[email protected]> Fri, 6 Jun 2003 01:43:08 +0200
| Newsgroups | gmane.lisp.clocc.devel |
|---|---|
| Message-ID | <[email protected]> |
Under LispWorks 4.2.7 probe-directory fails on stuff like (probe-directory (truename "/something")) The problem is due to the fact that LW truename fills all the unused structure slots with :UNSPECIFICs. I'd recommend to change probe-directory as follows: (defun probe-directory (filename) "Check whether the file name names an existing directory." ;; based on ;; From: Bill Schelter <[email protected]> ;; Date: Wed, 5 May 1999 11:51:19 -0500 ;; fold the name.type into directory #+lispworks (lw:file-directory-p filename) #-lispworks (let* ((path (pathname filename)) (name (pathname-name path)) (type (pathname-type path)) (new-dir (cond ((and name type) (list (concatenate 'string name "." type))) (name (list name)) (type (list type)) (t nil)))) (when new-dir (setq path (make-pathname :directory (append (pathname-directory path) new-dir) :name nil :type nil :defaults path))) #+allegro (excl::probe-directory path) #+clisp (values (ignore-errors (#+lisp=cl ext:probe-directory #-lisp=cl lisp:probe-directory path))) #+cmu (eq :directory (unix:unix-file-kind (namestring path))) #+sbcl (eq :directory (sb-unix:unix-file-kind (namestring path))) #-(or allegro clisp cmu sbcl) (probe-file path))) -- walter pelissero http://www.pelissero.de ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com.