emacs-diffs
[Top][All Lists]
Advanced

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

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


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

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

Modified files:
        lisp/net       : tramp-smb.el 

Log message:
        * net/tramp-smb.el (tramp-smb-errors): Add error message for
        connection timeout.
        (tramp-smb-handle-delete-directory): Handle optional parameter
        RECURSIVE.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/net/tramp-smb.el?cvsroot=emacs&r1=1.50&r2=1.51

Patches:
Index: tramp-smb.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp-smb.el,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- tramp-smb.el        29 Sep 2009 02:43:46 -0000      1.50
+++ tramp-smb.el        1 Oct 2009 15:40:13 -0000       1.51
@@ -87,6 +87,7 @@
      "NT_STATUS_ACCOUNT_LOCKED_OUT"
      "NT_STATUS_BAD_NETWORK_NAME"
      "NT_STATUS_CANNOT_DELETE"
+     "NT_STATUS_CONNECTION_REFUSED"
      "NT_STATUS_DIRECTORY_NOT_EMPTY"
      "NT_STATUS_DUPLICATE_NAME"
      "NT_STATUS_FILE_IS_A_DIRECTORY"
@@ -248,10 +249,19 @@
               v 0 "Copying file %s to file %s...done" filename newname)
            (tramp-error v 'file-error "Cannot copy `%s'" filename)))))))
 
-(defun tramp-smb-handle-delete-directory (directory)
+(defun tramp-smb-handle-delete-directory (directory &optional recursive)
   "Like `delete-directory' for Tramp files."
   (setq directory (directory-file-name (expand-file-name directory)))
   (when (file-exists-p directory)
+    (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 nil
       ;; We must also flush the cache of the directory, because
       ;; file-attributes reads the values from there.




reply via email to

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