diff options
| author | Michael Albinus <michael.albinus@gmx.de> | 2009-10-01 15:34:56 +0000 |
|---|---|---|
| committer | Michael Albinus <michael.albinus@gmx.de> | 2009-10-01 15:34:56 +0000 |
| commit | c15cdf02683f05e4b23c7a04e9238c26f1401440 (patch) | |
| tree | ca97950e3a7523892a78d538d33b6afff69b0939 | |
| parent | c90a8a9f8723eaad88b077f0f0b37cb543bd447f (diff) | |
| download | emacs-c15cdf02683f05e4b23c7a04e9238c26f1401440.tar.gz | |
* net/tramp.el (tramp-handle-make-directory): Flush upper
directory's file properties.
(tramp-handle-delete-directory): Handle optional parameter
RECURSIVE.
(tramp-handle-dired-recursive-delete-directory): Flush directory
properties after the remove command only.
| -rw-r--r-- | lisp/net/tramp.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index a558ccd41fd..f3c61e942be 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3583,6 +3583,7 @@ The method used must be an out-of-band method." "Like `make-directory' for Tramp files." (setq dir (expand-file-name dir)) (with-parsed-tramp-file-name dir nil + (tramp-flush-directory-property v (file-name-directory localname)) (save-excursion (tramp-barf-unless-okay v @@ -3591,14 +3592,17 @@ The method used must be an out-of-band method." (tramp-shell-quote-argument localname)) "Couldn't make directory %s" dir)))) -(defun tramp-handle-delete-directory (directory) +(defun tramp-handle-delete-directory (directory &optional recursive) "Like `delete-directory' for Tramp files." (setq directory (expand-file-name directory)) (with-parsed-tramp-file-name directory nil (tramp-flush-directory-property v localname) (unless (zerop (tramp-send-command-and-check v - (format "rmdir %s" (tramp-shell-quote-argument localname)))) + (format + "%s %s" + (if recursive "rm -rf" "rmdir") + (tramp-shell-quote-argument localname)))) (tramp-error v 'file-error "Couldn't delete %s" directory)))) (defun tramp-handle-delete-file (filename) @@ -3620,7 +3624,6 @@ The method used must be an out-of-band method." "Recursively delete the directory given. This is like `dired-recursive-delete-directory' for Tramp files." (with-parsed-tramp-file-name filename nil - (tramp-flush-directory-property v localname) ;; Run a shell command 'rm -r <localname>' ;; Code shamelessly stolen from the dired implementation and, um, hacked :) (unless (file-exists-p filename) @@ -3635,6 +3638,7 @@ This is like `dired-recursive-delete-directory' for Tramp files." ;; This might take a while, allow it plenty of time. (tramp-wait-for-output (tramp-get-connection-process v) 120) ;; Make sure that it worked... + (tramp-flush-directory-property v localname) (and (file-exists-p filename) (tramp-error v 'file-error "Failed to recursively delete %s" filename)))) |
