]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/tramp-fish.el (tramp-fish-handle-delete-directory): Handle
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 1 Oct 2009 15:35:35 +0000 (15:35 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 1 Oct 2009 15:35:35 +0000 (15:35 +0000)
optional parameter RECURSIVE.

lisp/net/tramp-fish.el

index aedae8797e14c344ccb27bdc2c6c3c56e57de694..215ada5d2343f28914f4c569f080ab866820c7da 100644 (file)
@@ -312,10 +312,19 @@ pass to the OPERATION."
   (tramp-fish-do-copy-or-rename-file
    'copy filename newname ok-if-already-exists keep-date preserve-uid-gid))
 
-(defun tramp-fish-handle-delete-directory (directory)
+(defun tramp-fish-handle-delete-directory (directory &optional recursive)
   "Like `delete-directory' for Tramp files."
   (when (file-exists-p directory)
-    (with-parsed-tramp-file-name
+    (if recursive
+       (mapc
+        (lambda (file)
+          (if (file-directory-p file)
+              (delete-directory file recursive)
+            (delete-file file)))
+        ;; We do not want to delete "." and "..".
+        (directory-files
+         directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")))
+     (with-parsed-tramp-file-name
        (directory-file-name (expand-file-name directory)) nil
       (tramp-flush-directory-property v localname)
       (tramp-fish-send-command-and-check v (format "#RMD %s" localname)))))