Changeset 10046


Ignore:
Timestamp:
09/27/05 15:41:06 (16 years ago)
Author:
piso
Message:

PROBE-DIRECTORY, DELETE-DIRECTORY

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/tests/file-system-tests.lisp

    r10045 r10046  
    4343
    4444(unless (find-package '#:test)
    45   (defpackage #:test (:use #:cl #:regression-test
    46                            #+abcl #:extensions)))
     45  (defpackage #:test (:use #:cl #:regression-test)))
    4746
    4847(in-package #:test)
     
    7776  (string= (namestring pathname1) (namestring pathname2)))
    7877
     78#+abcl
     79(defun run-shell-command (command &key directory (output *standard-output*))
     80  (ext:run-shell-command command :directory directory :output output))
     81
    7982#+allegro
    8083(defun run-shell-command (command &key directory (output *standard-output*))
     
    163166        (return-from make-temporary-filename pathname))))
    164167   (error "Unable to create a temporary filename in ~S~%" directory))
     168
     169(defun probe-directory (pathname)
     170  #+abcl (ext:probe-directory pathname)
     171  #+allegro (excl:probe-directory pathname)
     172  #+clisp (ext:probe-directory pathname)
     173  #+cmu (probe-file pathname) ; FIXME
     174  #+sbcl (probe-file pathname) ; FIXME
     175  )
     176
     177(defun delete-directory (pathname)
     178  #+abcl (delete-file pathname)
     179  #+allegro (excl:delete-directory pathname)
     180  #+clisp (ext:delete-dir (namestring pathname))
     181  #+cmu (unix:unix-rmdir (namestring pathname))
     182  #+sbcl (zerop (sb-posix:rmdir (namestring pathname)))
     183  )
    165184
    166185#-(or allegro clisp lispworks windows)
     
    289308                          (pathname directory-namestring))
    290309       ;; 4. Delete the directory.
    291        #+allegro
    292        (when (excl:probe-directory directory-namestring)
    293          (excl:delete-directory directory-namestring))
    294        #+clisp
    295        (when (ext:probe-directory directory-namestring)
    296          (ext:delete-dir directory-namestring))
    297        #+lispworks
    298        (when (probe-file directory-namestring)
    299          (lw:delete-directory directory-namestring))
    300        #-(or allegro clisp lispworks)
    301        (when (probe-file directory-namestring)
    302          #-(or cmu sbcl) (delete-file directory-namestring)
    303          #+cmu (unix:unix-rmdir directory-namestring)
    304          #+sbcl (zerop (sb-posix:rmdir directory-namestring)))
     310       (when (probe-directory directory-namestring)
     311         (delete-directory directory-namestring))
    305312       ;; 5. Verify that the directory is no longer there.
    306        #-clisp
    307        (probe-file directory-namestring)
    308        #+clisp
    309        (ext:probe-directory directory-namestring))))
     313       (probe-directory directory-namestring))
     314       ))
    310315  t t t t nil)
    311316
Note: See TracChangeset for help on using the changeset viewer.