# HG changeset patch # User Michael Albinus # Date 1254411613 0 # Node ID 5077632c39efccc072b80442b35660ee44ca2181 # Parent 4f1a9f15125385c2e05f61e44504ed4060d76a33 * net/tramp-smb.el (tramp-smb-errors): Add error message for connection timeout. (tramp-smb-handle-delete-directory): Handle optional parameter RECURSIVE. diff -r 4f1a9f151253 -r 5077632c39ef lisp/net/tramp-smb.el --- a/lisp/net/tramp-smb.el Thu Oct 01 15:39:25 2009 +0000 +++ b/lisp/net/tramp-smb.el Thu Oct 01 15:40:13 2009 +0000 @@ -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.