From thompdump at gmail.com Thu Apr 22 16:44:44 2010 From: thompdump at gmail.com (david thompson) Date: Thu, 22 Apr 2010 09:44:44 -0700 Subject: [eclipse-devel] when ~/.eclipse is already present as a directory Message-ID: With my first run of eclipse, eclipse discovered that ~/.eclipse is a directory and ground to a halt with couldn't read from #: Is a directory Maybe having eclipse gracefully switch gears -- e.g., something like the change below (in INITIALIZE) -- would be desirable? ... ;; load personal configuration file, or the default one. (labels ((load-if (f) (and (probe-file f) ;; try to ensure ~/.eclipse isn't a directory... (not (probe-file (concatenate 'string f "/."))) (load-config-file f)))) ... From hatchond at yahoo.fr Thu Apr 22 23:21:30 2010 From: hatchond at yahoo.fr (Iban HATCHONDO) Date: Thu, 22 Apr 2010 23:21:30 +0000 (GMT) Subject: [eclipse-devel] Re : when ~/.eclipse is already present as a directory In-Reply-To: References: Message-ID: <471061.64743.qm@web27603.mail.ukl.yahoo.com> Hi, Yes you're right ! The .eclipse directory created by the IDE is in the way. Wouldn't it more portable to do (not (probe-file (make-pathname :directory f))) ? Best, Iban. ----- Message d'origine ---- De : david thompson ? : eclipse-devel at common-lisp.net Envoy? le : Jeu 22 avril 2010, 18 h 44 min 44 s Objet : [eclipse-devel] when ~/.eclipse is already present as a directory With my first run of eclipse, eclipse discovered that ~/.eclipse is a directory and ground to a halt with couldn't read from #: Is a directory Maybe having eclipse gracefully switch gears -- e.g., something like the change below (in INITIALIZE) -- would be desirable? ... ;; load personal configuration file, or the default one. (labels ((load-if (f) (and (probe-file f) ;; try to ensure ~/.eclipse isn't a directory... (not (probe-file (concatenate 'string f "/."))) (load-config-file f)))) ... _______________________________________________ eclipse-devel site list eclipse-devel at common-lisp.net http://common-lisp.net/mailman/listinfo/eclipse-devel From hatchond at yahoo.fr Fri Apr 23 14:53:42 2010 From: hatchond at yahoo.fr (Iban HATCHONDO) Date: Fri, 23 Apr 2010 14:53:42 +0000 (GMT) Subject: [eclipse-devel] Re : Re : when ~/.eclipse is already present as a directory In-Reply-To: <471061.64743.qm@web27603.mail.ukl.yahoo.com> References: <471061.64743.qm@web27603.mail.ukl.yahoo.com> Message-ID: <309650.46685.qm@web27607.mail.ukl.yahoo.com> Hi, Thanks for pointing this out. I've committed a fix by adding a new predicate 'file-exists-p' that is used in the initialize sequence instead of probing the file directly. (defun file-exists-p (filename) "Returns true if the given filename is an existing file and not a directory." (and #+clisp (not (probe-directory (make-pathname :directory filename))) #-clisp (not (probe-file (make-pathname :directory filename))) (probe-file filename))) Best, Iban ----- Message d'origine ---- De : Iban HATCHONDO ? : eclipse-devel at common-lisp.net Envoy? le : Ven 23 avril 2010, 1 h 21 min 30 s Objet : [eclipse-devel] Re : when ~/.eclipse is already present as a directory Hi, Yes you're right ! The .eclipse directory created by the IDE is in the way. Wouldn't it more portable to do (not (probe-file (make-pathname :directory f))) ? Best, Iban. ----- Message d'origine ---- De : david thompson ? : eclipse-devel at common-lisp.net Envoy? le : Jeu 22 avril 2010, 18 h 44 min 44 s Objet : [eclipse-devel] when ~/.eclipse is already present as a directory With my first run of eclipse, eclipse discovered that ~/.eclipse is a directory and ground to a halt with couldn't read from #: Is a directory Maybe having eclipse gracefully switch gears -- e.g., something like the change below (in INITIALIZE) -- would be desirable? ... ;; load personal configuration file, or the default one. (labels ((load-if (f) (and (probe-file f) ;; try to ensure ~/.eclipse isn't a directory... (not (probe-file (concatenate 'string f "/."))) (load-config-file f)))) ... _______________________________________________ eclipse-devel site list eclipse-devel at common-lisp.net http://common-lisp.net/mailman/listinfo/eclipse-devel _______________________________________________ eclipse-devel site list eclipse-devel at common-lisp.net http://common-lisp.net/mailman/listinfo/eclipse-devel From thompdump at gmail.com Sat Apr 24 19:49:14 2010 From: thompdump at gmail.com (david thompson) Date: Sat, 24 Apr 2010 12:49:14 -0700 Subject: [eclipse-devel] 'built-in' config file not found by eclipse Message-ID: 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))) From hatchond at yahoo.fr Mon Apr 26 10:43:08 2010 From: hatchond at yahoo.fr (Iban HATCHONDO) Date: Mon, 26 Apr 2010 10:43:08 +0000 (GMT) Subject: [eclipse-devel] Re : 'built-in' config file not found by eclipse In-Reply-To: References: Message-ID: <255687.24774.qm@web27603.mail.ukl.yahoo.com> Well, you're right, I haven't paid attention that SBCL returns a valid pathname when probing a file with a pathname for a directory that is in reality a file. I would propose the following (after reading the interesting point CL-FAD) (defun file-exists-p (filename) "Returns true if the given filename is an existing file and not a directory." (and #+clisp (not (probe-directory (make-pathname :directory filename))) #-clisp (let ((pathname (probe-file (make-pathname :directory filename)))) ;; When NIL is returned by probe-file, it indicates that NO ;; directory exists under this filename. ;; But when a valid pathname is returned, it does not ;; necessarily indicate that it is a directory. ;; In this case, one needs to check if the returned pathname ;; has a type or a name, what a directory pathname doesn't ;; have. ;; This last case concerns systems like SBCL, while the former ;; case corresponds at least to CMUCL. (if pathname (let ((name (pathname-name pathname)) (type (pathname-type pathname))) (or (and type (not (eql type :unspecific))) (and name (not (eql type :unspecific))))) t)) (probe-file filename))) It seems be the proper way to deal with systems that have equivalent behavior to SBCL? Best, Iban. ----- Message d'origine ---- De : david thompson ? : eclipse-devel at common-lisp.net Envoy? le : Sam 24 avril 2010, 21 h 49 min 14 s Objet : [eclipse-devel] 'built-in' config file not found by eclipse 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))) _______________________________________________ eclipse-devel site list eclipse-devel at common-lisp.net http://common-lisp.net/mailman/listinfo/eclipse-devel From hatchond at yahoo.fr Tue Apr 27 12:10:31 2010 From: hatchond at yahoo.fr (Iban HATCHONDO) Date: Tue, 27 Apr 2010 12:10:31 +0000 (GMT) Subject: [eclipse-devel] Re : Re : 'built-in' config file not found by eclipse In-Reply-To: <255687.24774.qm@web27603.mail.ukl.yahoo.com> References: <255687.24774.qm@web27603.mail.ukl.yahoo.com> Message-ID: <548271.50167.qm@web27605.mail.ukl.yahoo.com> This has been committed in the CVS tree Best, Iban. ----- Message d'origine ---- De : Iban HATCHONDO ? : eclipse-devel at common-lisp.net Envoy? le : Lun 26 avril 2010, 12 h 43 min 08 s Objet : [eclipse-devel] Re : 'built-in' config file not found by eclipse Well, you're right, I haven't paid attention that SBCL returns a valid pathname when probing a file with a pathname for a directory that is in reality a file. I would propose the following (after reading the interesting point CL-FAD) (defun file-exists-p (filename) "Returns true if the given filename is an existing file and not a directory." (and #+clisp (not (probe-directory (make-pathname :directory filename))) #-clisp (let ((pathname (probe-file (make-pathname :directory filename)))) ;; When NIL is returned by probe-file, it indicates that NO ;; directory exists under this filename. ;; But when a valid pathname is returned, it does not ;; necessarily indicate that it is a directory. ;; In this case, one needs to check if the returned pathname ;; has a type or a name, what a directory pathname doesn't ;; have. ;; This last case concerns systems like SBCL, while the former ;; case corresponds at least to CMUCL. (if pathname (let ((name (pathname-name pathname)) (type (pathname-type pathname))) (or (and type (not (eql type :unspecific))) (and name (not (eql type :unspecific))))) t)) (probe-file filename))) It seems be the proper way to deal with systems that have equivalent behavior to SBCL? Best, Iban. ----- Message d'origine ---- De : david thompson ? : eclipse-devel at common-lisp.net Envoy? le : Sam 24 avril 2010, 21 h 49 min 14 s Objet : [eclipse-devel] 'built-in' config file not found by eclipse 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))) _______________________________________________ eclipse-devel site list eclipse-devel at common-lisp.net http://common-lisp.net/mailman/listinfo/eclipse-devel _______________________________________________ eclipse-devel site list eclipse-devel at common-lisp.net http://common-lisp.net/mailman/listinfo/eclipse-devel