0.8.5.12
authorDaniel Barlow <dan@telent.net>
Wed, 29 Oct 2003 03:37:22 +0000 (03:37 +0000)
committerDaniel Barlow <dan@telent.net>
Wed, 29 Oct 2003 03:37:22 +0000 (03:37 +0000)
SB-POSIX now converts pathnames to Unix filenames using
SB-INT:UNIX-NAMESTRING, instead of to CL namestrings (which
are not the same thing, especially when wildchard characters
are involved) with NAMESTRING

Bug report and fix both courtesy of Zach Beane.  Thanks.

contrib/sb-posix/macros.lisp
contrib/sb-posix/posix-tests.lisp
version.lisp-expr

index 00af8de..9f79a69 100644 (file)
@@ -1,7 +1,14 @@
 (in-package :sb-posix-internal)
 
+;;; some explanation may be necessary.  The namestring "[foo]" 
+;;; denotes a wild pathname.  When there's a file on the disk whose
+;;; Unix name is "[foo]", the appropriate CL namestring for it is
+;;; "\\[foo]".  So, don't call NAMESTRING, instead call a function
+;;; that gets us the Unix name
+
 (define-designator filename c-string
-  (pathname  (namestring (translate-logical-pathname filename)))
+  (pathname 
+   (sb-impl::unix-namestring (translate-logical-pathname filename) nil))
   (string filename))
 
 (define-designator file-descriptor (integer 32)
index 2d7dd63..f8e92b6 100644 (file)
        (sb-posix:rmdir dir)
        (sb-posix:syscall-errno c))))
   #.sb-posix::eacces)
+
+;;; see comment in filename's designator definition, in macros.lisp
+(deftest filename-designator.1
+    (progn
+      ;; we use run-program to bypass the wildcard quoting in the 
+      ;; highlevel CL functions like OPEN
+      (sb-ext:run-program "touch"
+                         (list
+                          (format nil "~A/[foo].txt"
+                                  (namestring *test-directory*)))
+                         :search t :wait t )
+      ;; if this test fails, it will probably be with
+      ;; "System call error 2 (No such file or directory)"
+      (let ((*default-pathname-defaults* *test-directory*))
+       (sb-posix:unlink (car (directory "*.txt")))))
+  0)
+                        
index a0b0e5d..2bcb03a 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.5.11"
+"0.8.5.12"