[eclipse-devel] 'built-in' config file not found by eclipse
david thompson
thompdump at gmail.com
Sat Apr 24 19:49:14 UTC 2010
I tried out the most recent CVS version. The problem with the
preexisting ~/.eclipse directory seems to be resolved. However, now
eclipse doesn't find the 'built-in' config file with SBCL:
EWMI> (eclipse::file-exists-p (eclipse-path "eclipserc"))
NIL
EWMI> (eclipse-path "eclipserc")
"/home/thomp/downloads/window-managers/eclipse-cvs/eclipse/eclipserc"
but the file is present:
d630:eclipse# ls -al
/home/thomp/downloads/window-managers/eclipse-cvs/eclipse/eclipserc
-rw-r--r-- 1 root root 2834 2003-08-28 07:51
/home/thomp/downloads/window-managers/eclipse-cvs/eclipse/eclipserc
I think the issue might be with FILE-EXISTS-P - in SBCL, it looks like
a nonsensical path is generated:
EWMI> (probe-file (eclipse-path "eclipserc"))
#P"/home/thomp/downloads/window-managers/eclipse-cvs/eclipse/eclipserc"
EWMI> (not (probe-file (make-pathname :directory (eclipse-path "eclipserc"))))
NIL
EWMI> (make-pathname :directory (eclipse-path "eclipserc"))
#P"//home/thomp/downloads/window-managers/eclipse-cvs/eclipse/eclipserc/"
CL-FAD has some 'directory-p and file-p'-ish functionality that is
intended to be portable across implementations. It might be a useful
starting point. On the other hand, I also vaguely remember some weird
behavior (e.g., I think the CL-FAD DIRECTORY-EXISTS-P function returns
a true value when fed an empty string).
For what it's worth, this (in global.lisp) seems to work with SBCL with linux:
(defun directory-p (pathname)
(let ((close?
(ignore-errors
(sb-posix:opendir pathname))))
(if close? (sb-posix:closedir close?))))
(defun file-exists-p (filename)
"Returns true if the given filename is an existing file and not a directory."
(and
#+sbcl (not (directory-p filename))
#+clisp (not (probe-directory (make-pathname :directory filename)))
#-(or :clisp :sbcl) (not (probe-file (make-pathname :directory filename)))
(probe-file filename)))
More information about the eclipse-devel
mailing list