[osicat-cvs] CVS update: src/osicat.asd src/osicat.lisp

Nikodemus Siivola nsiivola at common-lisp.net
Sun Apr 25 13:14:18 UTC 2004


Update of /project/osicat/cvsroot/src
In directory common-lisp.net:/tmp/cvs-serv18664

Modified Files:
	osicat.asd osicat.lisp 
Log Message:

* Die NORMPATH, die!

Date: Sun Apr 25 09:14:18 2004
Author: nsiivola

Index: src/osicat.asd
diff -u src/osicat.asd:1.8 src/osicat.asd:1.9
--- src/osicat.asd:1.8	Sun Apr 25 07:02:24 2004
+++ src/osicat.asd	Sun Apr 25 09:14:18 2004
@@ -83,7 +83,7 @@
 ;;;; TESTING
 
 (defsystem :osicat-test
-    :depends-on (:osicat :rt)
+    :depends-on (:osicat :rt #+sbcl :sb-posix)
     :components ((:file "test-tools")
 		 (:file "test-osicat" :depends-on ("test-tools"))))
 


Index: src/osicat.lisp
diff -u src/osicat.lisp:1.24 src/osicat.lisp:1.25
--- src/osicat.lisp:1.24	Sun Apr 25 08:24:12 2004
+++ src/osicat.lisp	Sun Apr 25 09:14:18 2004
@@ -91,24 +91,6 @@
 		  `(:relative ,@(subseq dir mismatch)))
      :defaults pathspec)))
 
-(defun normpath (pathspec &optional absolute)
-  (flet ((fixeddir (path)
-	   (let ((dir (pathname-directory
-		       (concatenate 'string (namestring path) "/"))))
-	     (if (member (car dir) '(:absolute :relative))
-		 dir
-		 (cons :relative dir)))))
-    (let ((path (absolute-pathname pathspec)))
-      (with-cstring (cfile (namestring path))
-	(let ((abspath (if (eq :directory (c-file-kind cfile t))
-			   (make-pathname :name nil :type nil
-					  :directory (fixeddir path)
-					  :defaults path)
-			   path)))
-	  (if absolute
-	      abspath
-	      (unmerge-pathnames abspath)))))))
-
 ;;;; FILE-KIND
 
 (defun file-kind (pathspec)
@@ -153,12 +135,13 @@
   (with-unique-names (one-iter)
     `(call-with-directory-iterator ,pathspec
       (lambda (,one-iter)
+	(declare (type function ,one-iter))
 	(macrolet ((,iterator () 
 		     `(funcall ,',one-iter)))
 	  , at body)))))
 
 (defun call-with-directory-iterator (pathspec fun)
-  (let ((dir (normpath pathspec t))
+  (let ((dir (absolute-pathname pathspec))
 	(old-dir (current-directory)))
     (with-c-file (cdir dir :directory t)
       (let (dp)
@@ -220,7 +203,7 @@
 
 Signals an error if pathspec is wild, doesn't designate a directory,
 or if the directory could not be deleted."
-  (with-c-file (path (normpath pathspec t) :directory)
+  (with-c-file (path (absolute-pathname pathspec) :directory)
     (if (zerop (rmdir path))
 	pathspec
 	(error "Could not delete directory ~S." pathspec))))
@@ -301,7 +284,7 @@
   (handler-bind
       ;; FIXME: Declare types properly to get rid of this.
       (#+sbcl (sb-ext:compiler-note #'muffle-warning))
-    (with-c-file (path (normpath pathspec t) :symbolic-link)
+    (with-c-file (path (absolute-pathname pathspec) :symbolic-link)
       (do* ((size 64 (* size 2))
 	    (buffer #1=(allocate-foreign-string size) #1#)
 	    (got (readlink path buffer size)))
@@ -333,7 +316,7 @@
 	 (with-c-file (old (if hard (merge-pathnames target link) target))
 	   (with-c-file (new link)
 	     (setf (current-directory) 
-		   (normpath *default-pathname-defaults* t))
+		   (absolute-pathname *default-pathname-defaults*))
 	     (if (zerop (funcall (if hard #'link #'symlink) old new))
 		 (pathname link)
 		 (error "MAKE-LINK: Could not create ~A link ~S -> ~S." 





More information about the Osicat-cvs mailing list