Mercurial > emacs
comparison lisp/net/tramp-smb.el @ 105354:5077632c39ef
* net/tramp-smb.el (tramp-smb-errors): Add error message for
connection timeout.
(tramp-smb-handle-delete-directory): Handle optional parameter
RECURSIVE.
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Thu, 01 Oct 2009 15:40:13 +0000 |
parents | 0c6bc9d2b10c |
children | 56aa7f20f7da |
comparison
equal
deleted
inserted
replaced
105353:4f1a9f151253 | 105354:5077632c39ef |
---|---|
85 ;; Windows 5.1 (Windows XP), Windows 5.2 (Windows Server 2003) | 85 ;; Windows 5.1 (Windows XP), Windows 5.2 (Windows Server 2003) |
86 "NT_STATUS_ACCESS_DENIED" | 86 "NT_STATUS_ACCESS_DENIED" |
87 "NT_STATUS_ACCOUNT_LOCKED_OUT" | 87 "NT_STATUS_ACCOUNT_LOCKED_OUT" |
88 "NT_STATUS_BAD_NETWORK_NAME" | 88 "NT_STATUS_BAD_NETWORK_NAME" |
89 "NT_STATUS_CANNOT_DELETE" | 89 "NT_STATUS_CANNOT_DELETE" |
90 "NT_STATUS_CONNECTION_REFUSED" | |
90 "NT_STATUS_DIRECTORY_NOT_EMPTY" | 91 "NT_STATUS_DIRECTORY_NOT_EMPTY" |
91 "NT_STATUS_DUPLICATE_NAME" | 92 "NT_STATUS_DUPLICATE_NAME" |
92 "NT_STATUS_FILE_IS_A_DIRECTORY" | 93 "NT_STATUS_FILE_IS_A_DIRECTORY" |
93 "NT_STATUS_LOGON_FAILURE" | 94 "NT_STATUS_LOGON_FAILURE" |
94 "NT_STATUS_NETWORK_ACCESS_DENIED" | 95 "NT_STATUS_NETWORK_ACCESS_DENIED" |
246 v (format "put %s \"%s\"" filename file)) | 247 v (format "put %s \"%s\"" filename file)) |
247 (tramp-message | 248 (tramp-message |
248 v 0 "Copying file %s to file %s...done" filename newname) | 249 v 0 "Copying file %s to file %s...done" filename newname) |
249 (tramp-error v 'file-error "Cannot copy `%s'" filename))))))) | 250 (tramp-error v 'file-error "Cannot copy `%s'" filename))))))) |
250 | 251 |
251 (defun tramp-smb-handle-delete-directory (directory) | 252 (defun tramp-smb-handle-delete-directory (directory &optional recursive) |
252 "Like `delete-directory' for Tramp files." | 253 "Like `delete-directory' for Tramp files." |
253 (setq directory (directory-file-name (expand-file-name directory))) | 254 (setq directory (directory-file-name (expand-file-name directory))) |
254 (when (file-exists-p directory) | 255 (when (file-exists-p directory) |
256 (if recursive | |
257 (mapc | |
258 (lambda (file) | |
259 (if (file-directory-p file) | |
260 (delete-directory file recursive) | |
261 (delete-file file))) | |
262 ;; We do not want to delete "." and "..". | |
263 (directory-files | |
264 directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))) | |
255 (with-parsed-tramp-file-name directory nil | 265 (with-parsed-tramp-file-name directory nil |
256 ;; We must also flush the cache of the directory, because | 266 ;; We must also flush the cache of the directory, because |
257 ;; file-attributes reads the values from there. | 267 ;; file-attributes reads the values from there. |
258 (tramp-flush-file-property v (file-name-directory localname)) | 268 (tramp-flush-file-property v (file-name-directory localname)) |
259 (tramp-flush-directory-property v localname) | 269 (tramp-flush-directory-property v localname) |