(/show0 "filesys.lisp 899")
;;; predicate to order pathnames by; goes by name
+;; FIXME: Does anything use this? It's not exported, and I don't find
+;; the name anywhere else.
(defun pathname-order (x y)
(let ((xn (%pathname-name x))
(yn (%pathname-name y)))
:device (pathname-device pathname)
:directory (subseq dir 0 i))))
(unless (probe-file newpath)
- (let ((namestring (coerce (namestring newpath) 'string)))
+ (let ((namestring (coerce (native-namestring newpath)
+ 'string)))
(when verbose
(format *standard-output*
"~&creating directory: ~A~%"
namestring))
(sb!unix:unix-mkdir namestring mode)
- (unless (probe-file namestring)
- (restart-case (error 'simple-file-error
- :pathname pathspec
- :format-control "can't create directory ~A"
- :format-arguments (list namestring))
+ (unless (probe-file newpath)
+ (restart-case (error
+ 'simple-file-error
+ :pathname pathspec
+ :format-control
+ "can't create directory ~A"
+ :format-arguments (list namestring))
(retry ()
:report "Retry directory creation."
- (ensure-directories-exist pathspec :verbose verbose :mode mode))
+ (ensure-directories-exist
+ pathspec
+ :verbose verbose :mode mode))
(continue ()
- :report "Continue as if directory creation was successful."
+ :report
+ "Continue as if directory creation was successful."
nil)))
(setf created-p t)))))
(values pathspec created-p))))
EOF
check_status_maybe_lose "DIRECTORY/TRUENAME part 3" $?
+# Test whether ENSURE-DIRECTORIES-EXIST can create a directory whose
+# name contains a wildcard character (it used to get itself confused
+# internally).
+run_sbcl --eval '(ensure-directories-exist "foo\\*bar/baz.txt")'
+test -d foo*bar
+check_status_maybe_lose "ENSURE-DIRECTORIES-EXIST part 1" $? \
+ 0 "(directory exists)"
+
+run_sbcl --eval '(ensure-directories-exist "foo\\?bar/baz.txt")'
+test -d foo?bar
+check_status_maybe_lose "ENSURE-DIRECTORIES-EXIST part 2" $? \
+ 0 "(directory exists)"
+
# success convention for script
exit $EXIT_TEST_WIN