From: Alastair B. <ala...@gm...> - 2010-06-19 00:31:42
|
Hello, [ One of these days I'll default to hitting reply-to-all. Sorry, Jerry, you're going to get this twice. ] I'll just point out that both SB-UNIX and SB-IMPL are "private" packages, and thus using them is explicitly not supported, and anything using them may be broken at any time. You would probably be better off with sb-posix:stat for this purpose. At the same time, you're already calling some version of stat, and you can pick off directoryness from the mode result, thus limiting yourself to actual supported interfaces, or if you want to still use sb-unix:unix-state only one unsupported interface. Seriously, (defun get-owner-and-mode (directory) (multiple-value-bind (res dev ino mode nlink uid) (sb-unix:unix-stat (namestring directory)) (declare (ignore res dev ino nlink)) (when (= sb-unix:s-ifdir (logand sb-unix:s-ifmt mode)) (values uid mode)))) (untested) is already an improvement, though still unsupported (as it uses sb-unix), and using sb-posix:stat and its related constants would actually be supported. --Alastair Bridgewater - Hide quoted text - On Fri, Jun 18, 2010 at 8:07 PM, Jerry James <log...@gm...> wrote: > On Fri, Jun 18, 2010 at 5:11 PM, GreyHat LispHacker > <gre...@gm...> wrote: >> >> Hello, >> >> I am using Ubuntu 9.04, and had installed an older version of SBCL >> (1.0.18) from the Debian repositories. >> >> I recently built the newer SBCL version (1.0.38) from source, followed the >> directions available, and got it up and running. >> >> I had tried to "debanize" the newer version of SBCL using the Debian CL >> Guidelines, >> http://pkg-common-lisp.alioth.debian.org/clid/clid.html >> >> but get the following error when I try to compile the ASDF system > > We had the same problem in Fedora. Rex Dieter fixed it by patching > common-lisp-controller, specifically > /usr/share/common-lisp/source/common-lisp-controller/post-sysdef-install.lisp, > so that the SBCL version of get-owner-and-mode looks like this: > > #+sbcl > (defun get-owner-and-mode (directory) > (when (eq :directory > (#.(or (find-symbol "NATIVE-FILE-KIND" :sb-impl) > (find-symbol "UNIX-FILE-KIND" :sb-unix)) > (namestring directory))) > ;; check who owns it > (multiple-value-bind (res dev ino mode nlink uid gid rdev size atime > mtime) > (sb-unix:unix-stat (namestring directory)) > > (declare (ignore res dev ino nlink gid rdev size atime mtime)) > (values uid mode)))) > > -- > Jerry James > http://www.jamezone.org/ |