Commit a14bdf88 authored by wlott's avatar wlott
Browse files

Replaced mach:unix-subtestname and lisp::predict-name with

mach:unix-file-kind and ext:unix-namestring.
parent b722a48c
......@@ -108,9 +108,9 @@
user will be asked whether it should be overwritten or not."
(cond
((not directoryp)
(multiple-value-bind (ses-name1 exists1p)
(lisp::predict-name spec1 t)
(let* ((ses-name2 (lisp::predict-name spec2 nil))
(let* ((ses-name1 (ext:unix-namestring spec1 t))
(exists1p (mach:unix-file-kind ses-name1))
(ses-name2 (ext:unix-namestring spec2 nil))
(pname1 (pathname ses-name1))
(pname2 (pathname ses-name2))
(dirp1 (directoryp pname1))
......@@ -148,13 +148,13 @@
(merge-pathnames pname2 pname1)
wildp1 update clobber))
(t (copy-file-1 pname1 wildp1 exists1p
pname2 wildp2 update clobber))))))
pname2 wildp2 update clobber)))))
(directory
(when (pathname-directory spec1)
(funcall *error-function*
"Spec1 is just a pattern when supplying directory -- ~S."
spec1))
(let* ((pname2 (pathname (lisp::predict-name spec2 nil)))
(let* ((pname2 (pathname (ext:unix-namestring spec2 nil)))
(dirp2 (directoryp pname2))
(wildp1 (wildcardp spec1))
(wildp2 (wildcardp (file-namestring pname2))))
......@@ -295,9 +295,9 @@
specify the trailing slash."
(cond
((not directoryp)
(multiple-value-bind (ses-name1 exists1p)
(lisp::predict-name spec1 t)
(let* ((ses-name2 (lisp::predict-name spec2 nil))
(let* ((ses-name1 (ext:unix-namestring spec1 t))
(exists1p (mach:unix-file-kind ses-name1))
(ses-name2 (ext:unix-namestring spec2 nil))
(pname1 (pathname ses-name1))
(pname2 (pathname ses-name2))
(dirp2 (directoryp pname2))
......@@ -318,14 +318,14 @@
(rename-file-1 pname1 wildp1 exists1p (merge-pathnames pname2
pname1)
wildp1 clobber)
(rename-file-1 pname1 wildp1 exists1p pname2 wildp2 clobber)))))
(rename-file-1 pname1 wildp1 exists1p pname2 wildp2 clobber))))
(directory
(when (pathname-directory spec1)
(funcall *error-function*
"Spec1 is just a pattern when supplying directory -- ~S."
spec1))
(let* ((pname2 (pathname (lisp::predict-name spec2 nil)))
(let* ((pname2 (pathname (ext:unix-namestring spec2 nil)))
(dirp2 (directoryp pname2))
(wildp1 (wildcardp spec1))
(wildp2 (wildcardp (file-namestring pname2))))
......@@ -434,7 +434,7 @@
subdirectory structure. An empty directory may be specified without
recursive being non-nil. When specifying a directory, the trailing slash
must be included."
(let* ((ses-name (lisp::predict-name spec t))
(let* ((ses-name (ext:unix-namestring spec t))
(pname (pathname ses-name))
(wildp (wildcardp (file-namestring pname)))
(dirp (directoryp pname)))
......@@ -549,10 +549,9 @@
(defun make-directory (name)
"Creates directory name. If name exists, then an error is signaled."
(multiple-value-bind (ses-name existsp)
(lisp::predict-name name nil)
(when existsp (funcall *error-function*
"Name already exists -- ~S" ses-name))
(let ((ses-name (ext:unix-namestring name nil)))
(when (mach:unix-file-kind ses-name)
(funcall *error-function* "Name already exists -- ~S" ses-name))
(enter-directory ses-name))
t)
......@@ -637,9 +636,7 @@
ses-name1 ses-name2 (mach:get-unix-error-msg err)))))
(defun directory-existsp (ses-name)
(multiple-value-bind (winp type)
(mach:unix-subtestname ses-name)
(and winp (eq type :entry_directory))))
(eq (mach:unix-file-kind ses-name) :directory))
(defun enter-directory (ses-name)
(declare (simple-string ses-name))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment