emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/net tramp.el


From: Michael Albinus
Subject: [Emacs-diffs] emacs/lisp/net tramp.el
Date: Thu, 01 Oct 2009 15:34:57 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       09/10/01 15:34:56

Modified files:
        lisp/net       : tramp.el 

Log message:
        * 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.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/net/tramp.el?cvsroot=emacs&r1=1.256&r2=1.257

Patches:
Index: tramp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp.el,v
retrieving revision 1.256
retrieving revision 1.257
diff -u -b -r1.256 -r1.257
--- tramp.el    28 Sep 2009 11:54:34 -0000      1.256
+++ tramp.el    1 Oct 2009 15:34:56 -0000       1.257
@@ -3583,6 +3583,7 @@
   "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 @@
               (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 @@
   "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 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))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]