diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2009-10-01 15:35:35 +0000 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2009-10-01 15:35:35 +0000 |
commit | ecacb4d68cab62f395955efd302fbd9dc9c21d0f (patch) | |
tree | 4abe4a80d5b0a6a2ddb43d52c69cd8d8f8ac95ac /lisp | |
parent | c15cdf02683f05e4b23c7a04e9238c26f1401440 (diff) | |
download | emacs-ecacb4d68cab62f395955efd302fbd9dc9c21d0f.tar.gz emacs-ecacb4d68cab62f395955efd302fbd9dc9c21d0f.tar.bz2 emacs-ecacb4d68cab62f395955efd302fbd9dc9c21d0f.zip |
* net/tramp-fish.el (tramp-fish-handle-delete-directory): Handle
optional parameter RECURSIVE.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/net/tramp-fish.el | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/net/tramp-fish.el b/lisp/net/tramp-fish.el index aedae8797e1..215ada5d234 100644 --- a/lisp/net/tramp-fish.el +++ b/lisp/net/tramp-fish.el @@ -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))))) |