(delete-file-with-children): New function; use it instead of "rm".
authortomo <tomo>
Fri, 22 Feb 2002 18:38:36 +0000 (18:38 +0000)
committertomo <tomo>
Fri, 22 Feb 2002 18:38:36 +0000 (18:38 +0000)
lisp/utf-2000/make-cdbs.el

index 5c455c5..2ecc050 100644 (file)
@@ -3,15 +3,30 @@
                    (or exec-directory
                        "../lib-src/")))
 
+
+(defun delete-file-with-children (filename)
+  (if (file-directory-p filename)
+      (let ((files
+            (directory-files filename 'full "^[^.]" 'so-sort)))
+       (if files
+           (dolist (file files)
+             (delete-file-with-children file)))
+       (remove-directory filename))
+    (delete-file filename)))
+
 (when (or load-ignore-elc-files
          (not (file-exists-p system-char-database-directory)))
-  (condition-case nil
-      (call-process "rm" nil nil nil "-rf" system-char-database-directory)
-    (error nil))
-
   (load "dumped-chars.el")
   (dolist (file system-char-db-source-file-list)
     (pureload file))
+  
+  ;;(condition-case nil
+  ;; (call-process "rm" nil 0 nil
+  ;;               "-rf" system-char-database-directory)
+  ;;(error (princ (format "Can't delete %s\n"
+  ;;             system-char-database-directory))))
+  (if (file-exists-p system-char-database-directory)
+      (delete-file-with-children system-char-database-directory))
 
   (dolist (attribute (char-attribute-list))
     (save-char-attribute-table attribute))